trait WebSocketSession extends AnyRef
Defines session for WebSocket connection.
- Alphabetic
- By Inheritance
- WebSocketSession
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
close(code: StatusCode = NormalClosure): Unit
Closes session with supplied status code.
Closes session with supplied status code.
- code
status code of closure
-
abstract
def
id: String
Gets session identifer.
-
abstract
def
idleTimeout(milliseconds: Int): WebSocketSession.this.type
Sets WebSocket idle timeout.
Sets WebSocket idle timeout.
Timeout of zero disables this option – i.e., timeout is indefinite.
- milliseconds
idle timeout
- returns
this session
- Note
If no activity transpires for specified duration, then session is closed with status code GoingAway.
-
abstract
def
idleTimeout: Int
Gets WebSocket idle timeout in milliseconds.
Gets WebSocket idle timeout in milliseconds.
Timeout of zero disables this option – i.e., timeout is indefinite.
- Note
If no activity transpires for specified duration, then session is closed with status code GoingAway.
-
abstract
def
isSecure: Boolean
Tests for secure WebSocket session.
-
abstract
def
logger: Logger
Gets logger associated with session.
-
abstract
def
messageCapacity(size: Int): WebSocketSession.this.type
Sets capacity of incoming message.
Sets capacity of incoming message.
- size
message capacity in bytes
- returns
this session
- Note
If message exceeds specified capacity, then session is closed with status code MessageTooBig.
-
abstract
def
messageCapacity: Int
Gets capacity of incoming message.
Gets capacity of incoming message.
- Note
If message exceeds specified capacity, then session is closed with status code MessageTooBig.
-
abstract
def
onBinary[T](handler: (Array[Byte]) ⇒ T): WebSocketSession.this.type
Sets handler for incoming binary message.
Sets handler for incoming binary message.
- handler
binary message handler
- returns
this session
-
abstract
def
onClose[T](handler: (StatusCode) ⇒ T): WebSocketSession.this.type
Sets handler to be notified when session closes.
Sets handler to be notified when session closes.
- handler
close handler
- returns
this session
-
abstract
def
onError[T](handler: (Throwable) ⇒ T): WebSocketSession.this.type
Sets handler to be notified when session error occurs.
Sets handler to be notified when session error occurs.
- handler
error handler
- returns
this session
-
abstract
def
onPing[T](handler: (Array[Byte]) ⇒ T): WebSocketSession.this.type
Sets handler for incoming ping message.
Sets handler for incoming ping message.
- handler
ping message handler
- returns
this session
-
abstract
def
onPong[T](handler: (Array[Byte]) ⇒ T): WebSocketSession.this.type
Sets handler for incoming pong message.
Sets handler for incoming pong message.
- handler
pong message handler
- returns
this session
-
abstract
def
onText[T](handler: (String) ⇒ T): WebSocketSession.this.type
Sets handler for incoming text message.
Sets handler for incoming text message.
- handler
text message handler
- returns
this session
-
abstract
def
open(): Unit
Opens session.
Opens session.
- Note
This method becomes an effective no-op if invoked more than once.
-
abstract
def
payloadLimit(length: Int): WebSocketSession.this.type
Gets payload limit of outgoing message.
Gets payload limit of outgoing message.
- length
payload limit in bytes
- returns
this session
- Note
If outgoing message exceeds specified limit, then message is sent over multiple frames.
-
abstract
def
payloadLimit: Int
Gets payload limit of outgoing message.
Gets payload limit of outgoing message.
- Note
If outgoing message exceeds specified limit, then message is sent over multiple frames.
-
abstract
def
ping(data: Array[Byte] = Array.empty): Unit
Sends ping message.
Sends ping message.
- data
application data to accompany ping message
-
abstract
def
pingAsync[T](data: Array[Byte] = Array.empty): Future[Unit]
Sends ping message asynchronously and on completion passes result to supplied callback.
Sends ping message asynchronously and on completion passes result to supplied callback.
- data
application data to accompany ping message
-
abstract
def
pong(data: Array[Byte] = Array.empty): Unit
Sends pong message.
Sends pong message.
- data
application data to accompany pong message
-
abstract
def
pongAsync[T](data: Array[Byte] = Array.empty): Future[Unit]
Sends pong message asynchronously and on completion passes result to supplied callback.
Sends pong message asynchronously and on completion passes result to supplied callback.
- data
application data to accompany pong message
-
abstract
def
protocolVersion: String
Gets WebSocket protocol version.
-
abstract
def
send(message: InputStream, binary: Boolean = false): Unit
Sends message.
Sends message.
If
binary
istrue
, then binary message is sent; otherwise, text message is sent.- message
input stream to message
- binary
indicator for binary message
-
abstract
def
send(message: Array[Byte]): Unit
Sends binary message.
Sends binary message.
- message
binary message
-
abstract
def
send(message: String): Unit
Sends text message.
Sends text message.
- message
text message
-
abstract
def
sendAsync[T](message: InputStream, binary: Boolean = false): Future[Unit]
Sends message asynchronously and on completion passes result to supplied callback.
Sends message asynchronously and on completion passes result to supplied callback.
If
binary
istrue
, then binary message is sent; otherwise, text message is sent.- message
input stream to message
- binary
indicator for binary message
-
abstract
def
sendAsync[T](message: Array[Byte]): Future[Unit]
Sends binary message asynchronously and on completion passes result to supplied callback.
Sends binary message asynchronously and on completion passes result to supplied callback.
- message
binary message
-
abstract
def
sendAsync[T](message: String): Future[Unit]
Sends text message asynchronously and on completion passes result to supplied callback.
Sends text message asynchronously and on completion passes result to supplied callback.
- message
text message
-
abstract
def
state: SessionState
Gets current state of WebSocket session.
-
abstract
def
target: Uri
Gets target of WebSocket request.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
Provided herein is API documentation for Scamper, the HTTP library for Scala.