public class RawWebSocket implements WebSocketSession
Represents a RAW web socket session
WebSocketSession.DefaultImpls| Constructor and Description |
|---|
RawWebSocket(kotlinx.coroutines.io.ByteReadChannel input,
kotlinx.coroutines.io.ByteWriteChannel output,
long maxFrameSize,
boolean masking,
NonExistentClass coroutineContext,
kotlinx.io.pool.ObjectPool<java.nio.ByteBuffer> pool)
Represents a RAW web socket session
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
close(java.lang.Throwable cause,
kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> p)
Close session with the specified cause or with no reason if
null |
java.lang.Object |
flush(kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> p)
Flush all outstanding messages and suspend until all earlier sent messages will be written. Could be called
at any time even after close. May return immediately if the connection is already terminated.
However it may also fail with an exception (or cancellation) at any point due to session failure.
Please note that
WebSocketSession.flush doesn't guarantee that frames were actually delivered. |
NonExistentClass |
getCoroutineContext() |
kotlinx.coroutines.channels.ReceiveChannel<io.ktor.http.cio.websocket.Frame> |
getIncoming()
Incoming frames channel
|
boolean |
getMasking()
Enable or disable masking output messages by a random xor mask.
Please note that changing this flag on the fly could be applied to the messages already sent (enqueued earlier)
as the sending pipeline works asynchronously
|
long |
getMaxFrameSize()
Specifies frame size limit. Connection will be closed if violated
|
kotlinx.coroutines.channels.SendChannel<io.ktor.http.cio.websocket.Frame> |
getOutgoing()
Outgoing frames channel. It could have limited capacity so sending too much frames may lead to suspension at
corresponding send invocations. It also may suspend if a peer doesn't read frames for some reason.
|
void |
setMasking(boolean p)
Enable or disable masking output messages by a random xor mask.
Please note that changing this flag on the fly could be applied to the messages already sent (enqueued earlier)
as the sending pipeline works asynchronously
|
void |
setMaxFrameSize(long p)
Specifies frame size limit. Connection will be closed if violated
|
void |
terminate()
Initiate connection termination immediately. Termination may complete asynchronously.
|
close, flush, getDispatcher, getIncoming, getMasking, getMaxFrameSize, getOutgoing, send, setMasking, setMaxFrameSize, terminatepublic RawWebSocket(kotlinx.coroutines.io.ByteReadChannel input,
kotlinx.coroutines.io.ByteWriteChannel output,
long maxFrameSize,
boolean masking,
NonExistentClass coroutineContext,
kotlinx.io.pool.ObjectPool<java.nio.ByteBuffer> pool)
Represents a RAW web socket session
public NonExistentClass getCoroutineContext()
public kotlinx.coroutines.channels.ReceiveChannel<io.ktor.http.cio.websocket.Frame> getIncoming()
Incoming frames channel
public kotlinx.coroutines.channels.SendChannel<io.ktor.http.cio.websocket.Frame> getOutgoing()
Outgoing frames channel. It could have limited capacity so sending too much frames may lead to suspension at corresponding send invocations. It also may suspend if a peer doesn't read frames for some reason.
public long getMaxFrameSize()
Specifies frame size limit. Connection will be closed if violated
public void setMaxFrameSize(long p)
Specifies frame size limit. Connection will be closed if violated
public boolean getMasking()
Enable or disable masking output messages by a random xor mask. Please note that changing this flag on the fly could be applied to the messages already sent (enqueued earlier) as the sending pipeline works asynchronously
public void setMasking(boolean p)
Enable or disable masking output messages by a random xor mask. Please note that changing this flag on the fly could be applied to the messages already sent (enqueued earlier) as the sending pipeline works asynchronously
public java.lang.Object flush(kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> p)
Flush all outstanding messages and suspend until all earlier sent messages will be written. Could be called
at any time even after close. May return immediately if the connection is already terminated.
However it may also fail with an exception (or cancellation) at any point due to session failure.
Please note that WebSocketSession.flush doesn't guarantee that frames were actually delivered.
WebSocketSession.flushpublic void terminate()
Initiate connection termination immediately. Termination may complete asynchronously.
public java.lang.Object close(java.lang.Throwable cause,
kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> p)
Close session with the specified cause or with no reason if null