| Modifier and Type | Field and Description |
|---|---|
| public static final int | ABNORMAL_CLOSE
a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. |
| public static final int | END_POINT_GOING_DOWN
Indicates that an endpoint is "going away", such as a server going down, or a browser having navigated away from a page. |
| public static final int | INVALID_DATA
Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g. an endpoint that understands only text data may send this if it receives a binary message.) |
| public static final int | MESSAGE_TOO_LARGE
indicates that an endpoint is terminating the connection because it has received a message that is too large. |
| public static final int | NO_STATUS_CODE
a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. |
| public static final int | NORMAL_CLOSURE
Indicates a normal closure, meaning whatever purpose the connection was established for has been fulfilled. |
| public static final int | PROTOCOL_ERROR
Indicates that an endpoint is terminating the connection due to a protocol error. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the listener was added, otherwise falsethe listener)WebSocketListener to add.Adds a |
| public void | |
| public void | |
| public void | broadcastFragment(final Iterable<? extends WebSocket> recipients, String data, boolean last)
Broadcasts the data fragment to the remote end-point set. |
| public void | broadcastFragment(final Iterable<? extends WebSocket> recipients, byte[] data, boolean last)
Broadcasts the data fragment to the remote end-point set. |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public void | |
| public void | onConnect()
This callback will be invoked when the opening handshake between both endpoints has been completed. |
| public void | onFragment(boolean
flag indicating whether or not the payload received is the final fragment of a message. last, String the text received from the remote end-point. payload)This callback will be invoked when a fragmented textual message has been received. |
| public void | onFragment(boolean
flag indicating whether or not the payload received is the final fragment of a message. last, byte[] the binary data received from the remote end-point. payload)This callback will be invoked when a fragmented binary message has been received. |
| public void | |
| public void | onMessage(byte[]
the binary data received from the remote end-point. data)This callback will be invoked when a binary message has been received. |
| public void | |
| public void | |
| public boolean | Returns: true if the listener was removed, otherwise falsethe listener)WebSocketListener to remote.Removes the specified |
| public GrizzlyFuture | Returns: GrizzlyFuture which could be used to control/check the sending completion state.Send a text frame to the remote end-point. |
| public GrizzlyFuture | Returns: GrizzlyFuture which could be used to control/check the sending completion state.Send a binary frame to the remote end-point. |
| public GrizzlyFuture | Returns: GrizzlyFuture which could be used to control/check the sending completion state.optional payload. Note that payload length is restricted to 125 bytes or less. data)Sends a |
| public GrizzlyFuture | Returns: GrizzlyFuture which could be used to control/check the sending completion state.optional payload. Note that payload length is restricted to 125 bytes or less. data)
Sends a |
| public GrizzlyFuture | Returns: GrizzlyFuture which could be used to control/check the sending completion state.boolean indicating if this message fragment is the last. last, String the textual fragment to send. fragment)Sends a fragment of a complete message. |
| public GrizzlyFuture | Returns: GrizzlyFuture which could be used to control/check the sending completion state.boolean indicating if this message fragment is the last. last, byte[] the binary fragment to send. fragment, int the offset within the fragment to send. off, int the number of bytes of the fragment to send. len)Sends a fragment of a complete message. |
| ABNORMAL_CLOSE | back to summary |
|---|---|
| public static final int ABNORMAL_CLOSE a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g. without sending or receiving a Close control frame. | |
| END_POINT_GOING_DOWN | back to summary |
|---|---|
| public static final int END_POINT_GOING_DOWN Indicates that an endpoint is "going away", such as a server going down, or a browser having navigated away from a page. | |
| INVALID_DATA | back to summary |
|---|---|
| public static final int INVALID_DATA Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g. an endpoint that understands only text data may send this if it receives a binary message.) | |
| MESSAGE_TOO_LARGE | back to summary |
|---|---|
| public static final int MESSAGE_TOO_LARGE indicates that an endpoint is terminating the connection because it has received a message that is too large. | |
| NO_STATUS_CODE | back to summary |
|---|---|
| public static final int NO_STATUS_CODE a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that no status code was actually present. | |
| NORMAL_CLOSURE | back to summary |
|---|---|
| public static final int NORMAL_CLOSURE Indicates a normal closure, meaning whatever purpose the connection was established for has been fulfilled. | |
| PROTOCOL_ERROR | back to summary |
|---|---|
| public static final int PROTOCOL_ERROR Indicates that an endpoint is terminating the connection due to a protocol error. | |
| add | back to summary |
|---|---|
| public boolean add(WebSocketListener listener) Adds a
| |
| broadcast | back to summary |
|---|---|
| public void broadcast(final Iterable<? extends WebSocket> recipients, String data) Broadcasts the data to the remote end-point set. | |
| broadcast | back to summary |
|---|---|
| public void broadcast(final Iterable<? extends WebSocket> recipients, byte[] data) Broadcasts the data to the remote end-point set. | |
| broadcastFragment | back to summary |
|---|---|
| public void broadcastFragment(final Iterable<? extends WebSocket> recipients, String data, boolean last) Broadcasts the data fragment to the remote end-point set. | |
| broadcastFragment | back to summary |
|---|---|
| public void broadcastFragment(final Iterable<? extends WebSocket> recipients, byte[] data, boolean last) Broadcasts the data fragment to the remote end-point set. | |
| close | back to summary |
|---|---|
| public void close()
Closes this | |
| close | back to summary |
|---|---|
| public void close(int code)
Closes this
| |
| close | back to summary |
|---|---|
| public void close(int code, String reason)
Closes this
| |
| isConnected | back to summary |
|---|---|
| public boolean isConnected()
Convenience method to determine if this
| |
| onClose | back to summary |
|---|---|
| public void onClose(DataFrame frame) This callback will be invoked when the remote end-point sent a closing frame. | |
| onConnect | back to summary |
|---|---|
| public void onConnect() This callback will be invoked when the opening handshake between both endpoints has been completed. | |
| onFragment | back to summary |
|---|---|
| public void onFragment(boolean last, String payload) This callback will be invoked when a fragmented textual message has been received.
| |
| onFragment | back to summary |
|---|---|
| public void onFragment(boolean last, byte[] payload) This callback will be invoked when a fragmented binary message has been received.
| |
| onMessage | back to summary |
|---|---|
| public void onMessage(String text) This callback will be invoked when a text message has been received.
| |
| onMessage | back to summary |
|---|---|
| public void onMessage(byte[] data) This callback will be invoked when a binary message has been received.
| |
| onPing | back to summary |
|---|---|
| public void onPing(DataFrame frame) This callback will be invoked when the remote end-point has sent a ping frame. | |
| onPong | back to summary |
|---|---|
| public void onPong(DataFrame frame) This callback will be invoked when the remote end-point has sent a pong frame. | |
| remove | back to summary |
|---|---|
| public boolean remove(WebSocketListener listener) Removes the specified
| |
| send | back to summary |
|---|---|
| public GrizzlyFuture Send a text frame to the remote end-point.
| |
| send | back to summary |
|---|---|
| public GrizzlyFuture Send a binary frame to the remote end-point.
| |
| sendPing | back to summary |
|---|---|
| public GrizzlyFuture Sends a
| |
| sendPong | back to summary |
|---|---|
| public GrizzlyFuture
Sends a It may seem odd to send a pong frame, however, RFC-6455 states: "A Pong frame MAY be sent unsolicited. This serves as a unidirectional heartbeat. A response to an unsolicited Pong frame is not expected."
| |
| stream | back to summary |
|---|---|
| public GrizzlyFuture Sends a fragment of a complete message.
| |
| stream | back to summary |
|---|---|
| public GrizzlyFuture Sends a fragment of a complete message.
| |