public interface WebSocket
Modifier and Type | Interface and Description |
---|---|
static class |
WebSocket.READYSTATE |
static class |
WebSocket.Role |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT
The default port of WebSockets, as defined in the spec.
|
static int |
DEFAULT_WSS_PORT |
Modifier and Type | Method and Description |
---|---|
void |
close()
Convenience function which behaves like close(CloseFrame.NORMAL)
|
void |
close(int code) |
void |
close(int code,
String message)
sends the closing handshake.
|
void |
closeConnection(int code,
String message)
This will close the connection immediately without a proper close handshake.
|
Draft |
getDraft() |
InetSocketAddress |
getLocalSocketAddress() |
WebSocket.READYSTATE |
getReadyState()
Retrieve the WebSocket 'readyState'.
|
InetSocketAddress |
getRemoteSocketAddress() |
boolean |
hasBufferedData() |
boolean |
isClosed()
Returns whether the close handshake has been completed and the socket is closed.
|
boolean |
isClosing() |
boolean |
isConnecting() |
boolean |
isFlushAndClose()
Returns true when no further frames may be submitted
This happens before the socket connection is closed. |
boolean |
isOpen() |
void |
send(byte[] bytes) |
void |
send(ByteBuffer bytes)
Send Binary data (plain bytes) to the other end.
|
void |
send(String text)
Send Text data to the other end.
|
void |
sendFrame(Framedata framedata) |
static final int DEFAULT_PORT
static final int DEFAULT_WSS_PORT
void close(int code, String message)
void close(int code)
void close()
void closeConnection(int code, String message)
void send(String text) throws NotYetConnectedException
void send(ByteBuffer bytes) throws IllegalArgumentException, NotYetConnectedException
void send(byte[] bytes) throws IllegalArgumentException, NotYetConnectedException
void sendFrame(Framedata framedata)
boolean hasBufferedData()
InetSocketAddress getRemoteSocketAddress()
InetSocketAddress getLocalSocketAddress()
boolean isConnecting()
boolean isOpen()
boolean isClosing()
boolean isFlushAndClose()
boolean isClosed()
Draft getDraft()
WebSocket.READYSTATE getReadyState()
Copyright © 2013. All Rights Reserved.