public class WebSocketContextStreamImpl extends java.lang.Object implements WebSocketContext, WebSocketConstants
CLOSE_ERROR, CLOSE_MESSAGE_TOO_BIG, CLOSE_OK, CLOSE_UTF8, FLAG_FIN, FLAG_MASK, MASK_OPCODE, OP_BINARY, OP_CLOSE, OP_CONT, OP_PING, OP_PONG, OP_TEXT, VERSION
Constructor and Description |
---|
WebSocketContextStreamImpl(WriteStream out) |
Modifier and Type | Method and Description |
---|---|
void |
close()
gracefully close the connection, waiting for unread messages.
|
void |
close(int code,
java.lang.String msg)
gracefully close the connection, waiting for unread messages.
|
<T> java.util.concurrent.BlockingQueue<T> |
createOutputQueue(WebSocketEncoder<T> encoder)
Creates a thread-safe queue, which applications can send objects to be
marshaled.
|
protected WebSocketInputStream |
createWebSocketInputStream(FrameInputStream is) |
void |
disconnect()
Disconnect the connection.
|
void |
flush()
flushes the output stream
|
long |
getTimeout()
Gets the read timeout.
|
protected WriteStream |
getWriteStream() |
boolean |
isAutoFlush()
returns the current flush mode.
|
void |
onClose(int closeCode,
java.lang.String closeMessage) |
void |
pong(byte[] bytes)
sends a pong message
|
void |
setAutoFlush(boolean isAutoFlush)
auto-flush after each message is sent.
|
void |
setTimeout(long timeout)
Sets the read timeout.
|
java.io.OutputStream |
startBinaryMessage()
Returns the output stream for a binary message.
|
java.io.PrintWriter |
startTextMessage()
Returns the output stream for a binary message.
|
java.lang.String |
toString() |
public WebSocketContextStreamImpl(WriteStream out)
public void setTimeout(long timeout)
WebSocketContext
setTimeout
in interface WebSocketContext
public long getTimeout()
WebSocketContext
getTimeout
in interface WebSocketContext
public java.io.OutputStream startBinaryMessage() throws java.io.IOException
WebSocketContext
startBinaryMessage
in interface WebSocketContext
java.io.IOException
public java.io.PrintWriter startTextMessage() throws java.io.IOException
WebSocketContext
startTextMessage
in interface WebSocketContext
java.io.IOException
public void pong(byte[] bytes)
WebSocketContext
pong
in interface WebSocketContext
public void close()
WebSocketContext
close
in interface WebSocketContext
public void close(int code, java.lang.String msg)
WebSocketContext
close
in interface WebSocketContext
protected WriteStream getWriteStream()
public void disconnect()
WebSocketContext
disconnect
in interface WebSocketContext
public void flush() throws java.io.IOException
WebSocketContext
flush
in interface WebSocketContext
java.io.IOException
protected WebSocketInputStream createWebSocketInputStream(FrameInputStream is) throws java.io.IOException
java.io.IOException
public void onClose(int closeCode, java.lang.String closeMessage)
onClose
in interface WebSocketContext
public java.lang.String toString()
toString
in class java.lang.Object
public <T> java.util.concurrent.BlockingQueue<T> createOutputQueue(WebSocketEncoder<T> encoder)
WebSocketContext
createOutputQueue
in interface WebSocketContext
public void setAutoFlush(boolean isAutoFlush)
WebSocketContext
setAutoFlush
in interface WebSocketContext
public boolean isAutoFlush()
WebSocketContext
isAutoFlush
in interface WebSocketContext