|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WebSocketContext
Bidirectional TCP connection based on a HTTP upgrade, e.g. WebSocket. The context and its values are not thread safe. The DuplexListener thread normally is the only thread reading from the input stream.
Method Summary | ||
---|---|---|
void |
close()
gracefully close the connection, waiting for unread messages. |
|
void |
close(int code,
java.lang.String message)
gracefully close the connection, waiting for unread messages. |
|
|
createOutputQueue(WebSocketEncoder<T> encoder)
Creates a thread-safe queue, which applications can send objects to be marshaled. |
|
void |
disconnect()
Disconnect the connection. |
|
void |
flush()
flushes the output stream |
|
long |
getTimeout()
Gets the read timeout. |
|
boolean |
isAutoFlush()
returns the current flush mode. |
|
void |
onClose(int closeCode,
java.lang.String closeMessage)
|
|
void |
pong(byte[] value)
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. |
Method Detail |
---|
<T> java.util.concurrent.BlockingQueue<T> createOutputQueue(WebSocketEncoder<T> encoder)
java.io.OutputStream startBinaryMessage() throws java.io.IOException
java.io.IOException
java.io.PrintWriter startTextMessage() throws java.io.IOException
java.io.IOException
void setTimeout(long timeout)
long getTimeout()
void setAutoFlush(boolean isAutoFlush)
boolean isAutoFlush()
void flush() throws java.io.IOException
java.io.IOException
void close()
void close(int code, java.lang.String message)
void pong(byte[] value) throws java.io.IOException
java.io.IOException
void disconnect()
void onClose(int closeCode, java.lang.String closeMessage)
closeCode
- closeMessage
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |