diff --git a/dist/WebSocket.jar b/dist/WebSocket.jar index 750656dd5..f6719a1ff 100644 Binary files a/dist/WebSocket.jar and b/dist/WebSocket.jar differ diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html index a30104b82..1c44fb745 100644 --- a/doc/allclasses-frame.html +++ b/doc/allclasses-frame.html @@ -2,12 +2,12 @@
- +| Base64 + | Base64
-Base64.InputStream +Base64.InputStream -Base64.OutputStream +Base64.OutputStream -Charsetfunctions +Charsetfunctions -Draft +ClientHandshake -Draft.HandshakeState +ClientHandshakeBuilder -Draft_10 +CloseFrame -Draft_17 +CloseFrameBuilder -Draft_75 +Draft -Draft_76 +Draft.CloseHandshakeType -FrameBuilder +Draft.HandshakeState -Framedata +Draft_10 -Framedata.Opcode +Draft_17 -FramedataImpl1 +Draft_75 -HandshakeBuilder +Draft_76 -Handshakedata +FrameBuilder -HandshakedataImpl1 +Framedata -IncompleteHandshakeException +Framedata.Opcode -InvalidDataException +FramedataImpl1 -InvalidFrameException +HandshakeBuilder -InvalidHandshakeException +Handshakedata -LimitExedeedException +HandshakedataImpl1 -WebSocket +HandshakeImpl1Client -WebSocket.Role +HandshakeImpl1Server -WebSocketAdapter +IncompleteHandshakeException -WebSocketClient +InvalidDataException -WebSocketServer +InvalidFrameException + +InvalidHandshakeException + +LimitExedeedException + +NotSendableException + +ServerHandshake + +ServerHandshakeBuilder + +WebSocket + +WebSocket.Role + +WebSocketAdapter + +WebSocketClient + +WebSocketListener + +WebSocketListener.MessageType + +WebSocketServer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Base64 + | Base64
-Base64.InputStream +Base64.InputStream -Base64.OutputStream +Base64.OutputStream -Charsetfunctions +Charsetfunctions -Draft +ClientHandshake -Draft.HandshakeState +ClientHandshakeBuilder -Draft_10 +CloseFrame -Draft_17 +CloseFrameBuilder -Draft_75 +Draft -Draft_76 +Draft.CloseHandshakeType -FrameBuilder +Draft.HandshakeState -Framedata +Draft_10 -Framedata.Opcode +Draft_17 -FramedataImpl1 +Draft_75 -HandshakeBuilder +Draft_76 -Handshakedata +FrameBuilder -HandshakedataImpl1 +Framedata -IncompleteHandshakeException +Framedata.Opcode -InvalidDataException +FramedataImpl1 -InvalidFrameException +HandshakeBuilder -InvalidHandshakeException +Handshakedata -LimitExedeedException +HandshakedataImpl1 -WebSocket +HandshakeImpl1Client -WebSocket.Role +HandshakeImpl1Server -WebSocketAdapter +IncompleteHandshakeException -WebSocketClient +InvalidDataException -WebSocketServer +InvalidFrameException + +InvalidHandshakeException + +LimitExedeedException + +NotSendableException + +ServerHandshake + +ServerHandshakeBuilder + +WebSocket + +WebSocket.Role + +WebSocketAdapter + +WebSocketClient + +WebSocketListener + +WebSocketListener.MessageType + +WebSocketServer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -net.tootallnate.* | +org.java_websocket.*
|---|
| net.tootallnate.websocket.Base64 | +org.java_websocket.WebSocket | ||||
|---|---|---|---|---|---|
| + |
public static final int |
-DECODE |
-0 |
+DEFAULT_PORT |
+80 |
| + |
public static final int |
-DO_BREAK_LINES |
-8 |
+READY_STATE_CLOSED |
+3 |
| + |
public static final int |
-DONT_GUNZIP |
-4 |
+READY_STATE_CLOSING |
+2 |
| + |
public static final int |
-ENCODE |
-1 |
+READY_STATE_CONNECTING |
+0 |
| + |
public static final int |
-GZIP |
-2 |
+READY_STATE_OPEN |
+1 |
+
+ +
+ +
| org.java_websocket.drafts.Draft_75 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-public static final int |
-NO_OPTIONS |
-0 |
+
+public static final byte |
+CR |
+13 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-public static final int |
-ORDERED |
-32 |
+
+public static final byte |
+END_OF_FRAME |
+-1 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-public static final int |
-URL_SAFE |
-16 |
+
+public static final byte |
+LF |
+10 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final byte |
+START_OF_FRAME |
+0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| net.tootallnate.websocket.WebSocket | +org.java_websocket.framing.CloseFrame | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| + |
public static final int |
-DEFAULT_PORT |
-80 |
+ABNROMAL_CLOSE |
+1006 |
+||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+BUGGYCLOSE |
+-2 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+EXTENSION |
+1010 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+FLASHPOLICY |
+-3 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+GOING_AWAY |
+1001 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+NEVERCONNECTED |
+-1 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+NO_UTF8 |
+1007 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+NOCODE |
+1005 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+NORMAL |
+1000 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+POLICY_VALIDATION |
+1008 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+PROTOCOL_ERROR |
+1002 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+REFUSE |
+1003 |
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+public static final int |
+TOOBIG |
+1009 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| net.tootallnate.websocket.drafts.Draft_75 | +org.java_websocket.util.Base64 | ||||
|---|---|---|---|---|---|
-public static final byte |
-CR |
-13 |
+
+public static final int |
+DECODE |
+0 |
-public static final byte |
-END_OF_FRAME |
--1 |
+
+public static final int |
+DO_BREAK_LINES |
+8 |
-public static final byte |
-LF |
-10 |
+
+public static final int |
+DONT_GUNZIP |
+4 |
-public static final byte |
-START_OF_FRAME |
+
+public static final int |
+ENCODE |
+1 |
+|
+public static final int |
+GZIP |
+2 |
+|||
+public static final int |
+NO_OPTIONS |
0 |
|||
+public static final int |
+ORDERED |
+32 |
+|||
+public static final int |
+URL_SAFE |
+16 |
+|||
Base64.InputStream will read data from another
+Base64.InputStream will read data from another
java.io.InputStream, given in the constructor,
- and encode/decode to/from Base64 notation on the fly.Base64.InputStream in DECODE mode.
-Base64.InputStream in
+ and encode/decode to/from Base64 notation on the fly.Base64.InputStream in DECODE mode.
+Base64.InputStream in
either ENCODE or DECODE mode.
-Base64.OutputStream will write data to another
+Base64.OutputStream will write data to another
java.io.OutputStream, given in the constructor,
- and encode/decode to/from Base64 notation on the fly.Base64.OutputStream in ENCODE mode.
-Base64.OutputStream in
+ and encode/decode to/from Base64 notation on the fly.Base64.OutputStream in ENCODE mode.
+Base64.OutputStream in
either ENCODE or DECODE mode.
-raw ByteBuffer,
writing it to the encoded ByteBuffer.
-raw ByteBuffer,
writing it to the encoded CharBuffer.
-Base64.encodeBytes(byte[]) but returns
+Base64.encodeBytes(byte[]) but returns
a byte array instead of instantiating a String.
-Base64.encodeBytes(byte[], int, int, int) but returns
+Base64.encodeBytes(byte[], int, int, int) but returns
a byte array instead of instantiating a String.
-Base64.InputStream.read() repeatedly until the end of stream
+Base64.InputStream.read() repeatedly until the end of stream
is reached or len bytes are read.
-WebSocketServer and WebSocketClient.
-WebSocketServer and WebSocketClient.
+Base64.OutputStream.write(int) repeatedly until len
+Base64.OutputStream.write(int) repeatedly until len
bytes are written.
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object -- -net.tootallnate.websocket.Draft -
public abstract class Draft
-
| -Nested Class Summary | -|
|---|---|
-static class |
-Draft.HandshakeState
-
-- |
-
| -Field Summary | -|
|---|---|
-protected WebSocket.Role |
-role
-
-- |
-
| -Constructor Summary | -|
|---|---|
Draft()
-
-- |
-|
| -Method Summary | -|
|---|---|
-abstract Draft.HandshakeState |
-acceptHandshakeAsClient(Handshakedata request,
- Handshakedata response)
-
-- |
-
-abstract Draft.HandshakeState |
-acceptHandshakeAsServer(Handshakedata handshakedata)
-
-- |
-
-protected boolean |
-basicAccept(Handshakedata handshakedata)
-
-- |
-
- int |
-checkAlloc(int bytecount)
-
-- |
-
-abstract java.nio.ByteBuffer |
-createBinaryFrame(Framedata framedata)
-
-- |
-
-abstract java.util.List<Framedata> |
-createFrames(byte[] binary,
- boolean mask)
-
-- |
-
-abstract java.util.List<Framedata> |
-createFrames(java.lang.String text,
- boolean mask)
-
-- |
-
- java.util.List<java.nio.ByteBuffer> |
-createHandshake(Handshakedata handshakedata,
- WebSocket.Role ownrole)
-
-- |
-
- java.util.List<java.nio.ByteBuffer> |
-createHandshake(Handshakedata handshakedata,
- WebSocket.Role ownrole,
- boolean withcontent)
-
-- |
-
-abstract HandshakeBuilder |
-postProcessHandshakeRequestAsClient(HandshakeBuilder request)
-
-- |
-
-abstract HandshakeBuilder |
-postProcessHandshakeResponseAsServer(Handshakedata request,
- HandshakeBuilder response)
-
-- |
-
-static java.nio.ByteBuffer |
-readLine(java.nio.ByteBuffer buf)
-
-- |
-
-static java.lang.String |
-readStringLine(java.nio.ByteBuffer buf)
-
-- |
-
-abstract void |
-reset()
-
-- |
-
- void |
-setParseMode(WebSocket.Role role)
-
-- |
-
-abstract java.util.List<Framedata> |
-translateFrame(java.nio.ByteBuffer buffer)
-
-- |
-
- Handshakedata |
-translateHandshake(java.nio.ByteBuffer buf)
-
-- |
-
-static HandshakeBuilder |
-translateHandshakeHttp(java.nio.ByteBuffer buf)
-
-- |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Field Detail | -
|---|
-protected WebSocket.Role role-
| -Constructor Detail | -
|---|
-public Draft()-
| -Method Detail | -
|---|
-public static java.nio.ByteBuffer readLine(java.nio.ByteBuffer buf)-
-public static java.lang.String readStringLine(java.nio.ByteBuffer buf)-
-public static HandshakeBuilder translateHandshakeHttp(java.nio.ByteBuffer buf) - throws InvalidHandshakeException-
InvalidHandshakeException-public abstract Draft.HandshakeState acceptHandshakeAsClient(Handshakedata request, - Handshakedata response) - throws InvalidHandshakeException-
InvalidHandshakeException-public abstract Draft.HandshakeState acceptHandshakeAsServer(Handshakedata handshakedata) - throws InvalidHandshakeException-
InvalidHandshakeException-protected boolean basicAccept(Handshakedata handshakedata)-
-public abstract java.nio.ByteBuffer createBinaryFrame(Framedata framedata)-
-public abstract java.util.List<Framedata> createFrames(byte[] binary, - boolean mask)-
-public abstract java.util.List<Framedata> createFrames(java.lang.String text, - boolean mask)-
-public abstract void reset()-
-public java.util.List<java.nio.ByteBuffer> createHandshake(Handshakedata handshakedata, - WebSocket.Role ownrole)-
-public java.util.List<java.nio.ByteBuffer> createHandshake(Handshakedata handshakedata, - WebSocket.Role ownrole, - boolean withcontent)-
-public abstract HandshakeBuilder postProcessHandshakeRequestAsClient(HandshakeBuilder request) - throws InvalidHandshakeException-
InvalidHandshakeException-public abstract HandshakeBuilder postProcessHandshakeResponseAsServer(Handshakedata request, - HandshakeBuilder response) - throws InvalidHandshakeException-
InvalidHandshakeException-public abstract java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) - throws InvalidDataException-
InvalidDataException-public Handshakedata translateHandshake(java.nio.ByteBuffer buf) - throws InvalidHandshakeException-
InvalidHandshakeException-public int checkAlloc(int bytecount) - throws LimitExedeedException, - InvalidDataException-
LimitExedeedException
-InvalidDataException-public void setParseMode(WebSocket.Role role)-
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.FramedataImpl1 -
public class FramedataImpl1
-
| -Nested Class Summary | -
|---|
| Nested classes/interfaces inherited from interface net.tootallnate.websocket.Framedata | -
|---|
Framedata.Opcode |
-
| -Constructor Summary | -|
|---|---|
FramedataImpl1()
-
-- |
-|
FramedataImpl1(Framedata.Opcode op)
-
-- |
-|
FramedataImpl1(Framedata f)
-
-- |
-|
| -Method Summary | -|
|---|---|
- void |
-append(Framedata nextframe)
-
-- |
-
- Framedata.Opcode |
-getOpcode()
-
-- |
-
- byte[] |
-getPayloadData()
-
-- |
-
- boolean |
-getTransfereMasked()
-
-- |
-
- boolean |
-isFin()
-
-- |
-
- void |
-setFin(boolean fin)
-
-- |
-
- void |
-setOptcode(Framedata.Opcode optcode)
-
-- |
-
- void |
-setPayload(byte[] payload)
-
-- |
-
- void |
-setTransferemasked(boolean transferemasked)
-
-- |
-
- java.lang.String |
-toString()
-
-- |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public FramedataImpl1()-
-public FramedataImpl1(Framedata.Opcode op)-
-public FramedataImpl1(Framedata f)-
| -Method Detail | -
|---|
-public boolean isFin()- -
-public Framedata.Opcode getOpcode()- -
-public boolean getTransfereMasked()-
getTransfereMasked in interface Framedata-public byte[] getPayloadData()-
getPayloadData in interface Framedata-public void setFin(boolean fin)-
setFin in interface FrameBuilder-public void setOptcode(Framedata.Opcode optcode)-
setOptcode in interface FrameBuilder-public void setPayload(byte[] payload)-
setPayload in interface FrameBuilder-public void setTransferemasked(boolean transferemasked)-
setTransferemasked in interface FrameBuilder-public void append(Framedata nextframe) - throws InvalidFrameException-
InvalidFrameException-public java.lang.String toString()-
toString in class java.lang.Object
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.WebSocket -
public final class WebSocket
-Represents one end (client or server) of a single WebSocket connection. - Takes care of the "handshake" phase, then allows for easy sending of - text frames, and recieving frames through an event-based model. - - This is an inner class, used by WebSocketClient and WebSocketServer, and should never need to be instantiated directly - by your code. However, instances are exposed in WebSocketServer through the onClientOpen, onClientClose, - onClientMessage callbacks. -
- -
-
| -Nested Class Summary | -|
|---|---|
-static class |
-WebSocket.Role
-
-- |
-
| -Field Summary | -|
|---|---|
-static boolean |
-DEBUG
-
-- |
-
-static int |
-DEFAULT_PORT
-
-- The default port of WebSockets, as defined in the spec. |
-
- java.util.List<Draft> |
-known_drafts
-
-- |
-
| -Constructor Summary | -|
|---|---|
WebSocket(net.tootallnate.websocket.WebSocketListener listener,
- Draft draft,
- java.nio.channels.SocketChannel sockchannel)
-
-- Used in WebSocketServer and WebSocketClient. |
-|
WebSocket(net.tootallnate.websocket.WebSocketListener listener,
- java.util.List<Draft> drafts,
- java.nio.channels.SocketChannel sockchannel)
-
-- |
-|
| -Method Summary | -|
|---|---|
- void |
-abort()
-
-- |
-
- void |
-abort(java.lang.String problemmessage)
-
-- |
-
- void |
-close()
-
-- Closes the underlying SocketChannel, and calls the listener's onClose - event handler. |
-
- java.net.InetSocketAddress |
-getLocalSocketAddress()
-
-- |
-
- java.net.InetSocketAddress |
-getRemoteSocketAddress()
-
-- |
-
- void |
-handleRead()
-
-- Should be called when a Selector has a key that is writable for this - WebSocket's SocketChannel connection. |
-
- void |
-handleWrite()
-
-- |
-
- Draft.HandshakeState |
-isFlashEdgeCase(java.nio.ByteBuffer request)
-
-- |
-
- void |
-send(byte[] bytes)
-
-- |
-
- void |
-send(java.lang.String text)
-
-- |
-
- void |
-sendFrame(Framedata framedata)
-
-- |
-
- void |
-startHandshake(HandshakeBuilder handshakedata)
-
-- |
-
- java.lang.String |
-toString()
-
-- |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
-
| -Field Detail | -
|---|
-public static final int DEFAULT_PORT-
-
-public static boolean DEBUG-
-public java.util.List<Draft> known_drafts-
| -Constructor Detail | -
|---|
-public WebSocket(net.tootallnate.websocket.WebSocketListener listener, - Draft draft, - java.nio.channels.SocketChannel sockchannel)-
WebSocketServer and WebSocketClient.
--
socketChannel - The SocketChannel instance to read and
- write to. The channel should already be registered
- with a Selector before construction of this object.listener - The WebSocketListener to notify of events when
- they occur.-public WebSocket(net.tootallnate.websocket.WebSocketListener listener, - java.util.List<Draft> drafts, - java.nio.channels.SocketChannel sockchannel)-
| -Method Detail | -
|---|
-public void handleRead() - throws java.lang.InterruptedException, - java.io.IOException-
-
java.io.IOException - When socket related I/O errors occur.
-java.lang.InterruptedException-public void abort()-
-public void abort(java.lang.String problemmessage)-
-public void close()-
-
-public void send(java.lang.String text) - throws java.lang.IllegalArgumentException, - java.nio.channels.NotYetConnectedException, - java.lang.InterruptedException-
java.io.IOException
-java.lang.InterruptedException
-java.lang.IllegalArgumentException
-java.nio.channels.NotYetConnectedException-public void send(byte[] bytes) - throws java.lang.IllegalArgumentException, - java.nio.channels.NotYetConnectedException, - java.lang.InterruptedException-
java.lang.IllegalArgumentException
-java.nio.channels.NotYetConnectedException
-java.lang.InterruptedException-public void sendFrame(Framedata framedata) - throws java.lang.InterruptedException-
java.lang.InterruptedException-public void handleWrite() - throws java.io.IOException-
java.io.IOException-public Draft.HandshakeState isFlashEdgeCase(java.nio.ByteBuffer request)-
-public void startHandshake(HandshakeBuilder handshakedata) - throws InvalidHandshakeException, - java.lang.InterruptedException-
InvalidHandshakeException
-java.lang.InterruptedException-public java.net.InetSocketAddress getRemoteSocketAddress()-
-public java.net.InetSocketAddress getLocalSocketAddress()-
-public java.lang.String toString()-
toString in class java.lang.Object
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.WebSocketAdapter -
public abstract class WebSocketAdapter
-
| -Constructor Summary | -|
|---|---|
WebSocketAdapter()
-
-- |
-|
| -Method Summary | -|
|---|---|
- java.lang.String |
-getFlashPolicy(WebSocket conn)
-
-- Gets the XML string that should be returned if a client requests a Flash - security policy. |
-
- void |
-onClose(WebSocket conn)
-
-- Called after WebSocket#close is explicity called, or when the - other end of the WebSocket connection is closed. |
-
- void |
-onError(WebSocket conn,
- java.lang.Exception ex)
-
-- |
-
- boolean |
-onHandshakeRecievedAsClient(WebSocket conn,
- Handshakedata request,
- Handshakedata response)
-
-- |
-
- HandshakeBuilder |
-onHandshakeRecievedAsServer(WebSocket conn,
- Draft draft,
- Handshakedata request)
-
-- Called when the socket connection is first established, and the WebSocket - handshake has been recieved. |
-
- void |
-onMessage(WebSocket conn,
- byte[] blob)
-
-- |
-
- void |
-onMessage(WebSocket conn,
- java.lang.String message)
-
-- Called when an entire text frame has been recieved. |
-
- void |
-onOpen(WebSocket conn)
-
-- Called after onHandshakeRecieved returns true. |
-
- void |
-onPing(WebSocket conn,
- Framedata f)
-
-- |
-
- void |
-onPong(WebSocket conn,
- Framedata f)
-
-- |
-
- void |
-onWriteDemand(WebSocket conn)
-
-- |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public WebSocketAdapter()-
| -Method Detail | -
|---|
-public HandshakeBuilder onHandshakeRecievedAsServer(WebSocket conn, - Draft draft, - Handshakedata request) - throws java.io.IOException-
-
java.io.IOException-public boolean onHandshakeRecievedAsClient(WebSocket conn, - Handshakedata request, - Handshakedata response) - throws java.io.IOException-
java.io.IOException-public void onMessage(WebSocket conn, - java.lang.String message)-
-
conn - The WebSocket instance this event is occuring on.message - The UTF-8 decoded message that was recieved.-public void onOpen(WebSocket conn)-
-
conn - The WebSocket instance this event is occuring on.-public void onClose(WebSocket conn)-
-
conn - The WebSocket instance this event is occuring on.-public void onMessage(WebSocket conn, - byte[] blob)-
-public void onPing(WebSocket conn, - Framedata f)-
-public void onPong(WebSocket conn, - Framedata f)-
-public java.lang.String getFlashPolicy(WebSocket conn)-
-
-public void onError(WebSocket conn, - java.lang.Exception ex)-
-public void onWriteDemand(WebSocket conn)-
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.WebSocketAdapter -
net.tootallnate.websocket.WebSocketClient -
public abstract class WebSocketClient
-The WebSocketClient is an abstract class that expects a valid - "ws://" URI to connect to. When connected, an instance recieves important - events related to the life of the connection. A subclass must implement - onOpen, onClose, and onMessage to be - useful. An instance can send messages to it's connected server via the - send method. -
- -
-
| -Constructor Summary | -|
|---|---|
WebSocketClient(java.net.URI serverURI)
-
-- |
-|
WebSocketClient(java.net.URI serverUri,
- Draft draft)
-
-- Constructs a WebSocketClient instance and sets it to the connect to the - specified URI. |
-|
| -Method Summary | -|
|---|---|
- java.lang.Thread |
-close()
-
-- Calls close on the underlying SocketChannel, which in turn - closes the socket connection, and ends the client socket thread. |
-
- void |
-connect()
-
-- Starts a background thread that attempts and maintains a WebSocket - connection to the URI specified in the constructor or via setURI. |
-
- Draft |
-getDraft()
-
-- |
-
- java.net.URI |
-getURI()
-
-- Gets the URI that this WebSocketClient is connected to. |
-
-abstract void |
-onClose()
-
-- |
-
- void |
-onClose(WebSocket conn)
-
-- Calls subclass' implementation of onClose. |
-
-abstract void |
-onError(java.lang.Exception ex)
-
-- |
-
- void |
-onError(WebSocket conn,
- java.io.IOException ex)
-
-- Calls subclass' implementation of onIOError. |
-
-abstract void |
-onMessage(java.lang.String message)
-
-- |
-
- void |
-onMessage(WebSocket conn,
- java.lang.String message)
-
-- Calls subclass' implementation of onMessage. |
-
-abstract void |
-onOpen()
-
-- |
-
- void |
-onOpen(WebSocket conn)
-
-- Calls subclass' implementation of onOpen. |
-
- void |
-onWriteDemand(WebSocket conn)
-
-- |
-
- void |
-run()
-
-- |
-
- void |
-send(java.lang.String text)
-
-- Sends text to the connected WebSocket server. |
-
| Methods inherited from class net.tootallnate.websocket.WebSocketAdapter | -
|---|
getFlashPolicy, onError, onHandshakeRecievedAsClient, onHandshakeRecievedAsServer, onMessage, onPing, onPong |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public WebSocketClient(java.net.URI serverURI)-
-public WebSocketClient(java.net.URI serverUri, - Draft draft)-
-
| -Method Detail | -
|---|
-public java.net.URI getURI()-
-
-public Draft getDraft()-
-public void connect()-
-
-public java.lang.Thread close()-
-
-public void send(java.lang.String text) - throws java.nio.channels.NotYetConnectedException, - java.lang.InterruptedException-
-
text - The String to send to the WebSocket server.
-java.nio.channels.NotYetConnectedException
-java.lang.InterruptedException-public void run()-
run in interface java.lang.Runnable-public void onMessage(WebSocket conn, - java.lang.String message)-
-
onMessage in class WebSocketAdapterconn - message - -public void onOpen(WebSocket conn)-
-
onOpen in class WebSocketAdapterconn - -public void onClose(WebSocket conn)-
-
onClose in class WebSocketAdapterconn - -public void onError(WebSocket conn, - java.io.IOException ex)-
-
conn - -public void onWriteDemand(WebSocket conn)-
-public abstract void onMessage(java.lang.String message)-
-public abstract void onOpen()-
-public abstract void onClose()-
-public abstract void onError(java.lang.Exception ex)-
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.WebSocketAdapter -
net.tootallnate.websocket.WebSocketServer -
public abstract class WebSocketServer
-WebSocketServer is an abstract class that only takes care of the - HTTP handshake portion of WebSockets. It's up to a subclass to add - functionality/purpose to the server. -
- -
-
| -Constructor Summary | -|
|---|---|
WebSocketServer()
-
-- Nullary constructor. |
-|
WebSocketServer(java.net.InetSocketAddress address)
-
-- Creates a WebSocketServer that will attempt to listen on port - port. |
-|
WebSocketServer(java.net.InetSocketAddress address,
- Draft draft)
-
-- Creates a WebSocketServer that will attempt to listen on port port, - and comply with Draft version draft. |
-|
| -Method Summary | -|
|---|---|
- java.util.Set<WebSocket> |
-connections()
-
-- Returns a WebSocket[] of currently connected clients. |
-
- java.net.InetSocketAddress |
-getAddress()
-
-- |
-
- Draft |
-getDraft()
-
-- |
-
-protected java.lang.String |
-getFlashSecurityPolicy()
-
-- Gets the XML string that should be returned if a client requests a Flash - security policy. |
-
- int |
-getPort()
-
-- Gets the port number that this server listens on. |
-
-abstract void |
-onClientClose(WebSocket conn)
-
-- |
-
-abstract void |
-onClientMessage(WebSocket conn,
- java.lang.String message)
-
-- |
-
-abstract void |
-onClientOpen(WebSocket conn)
-
-- |
-
- void |
-onClose(WebSocket conn)
-
-- Called after WebSocket#close is explicity called, or when the - other end of the WebSocket connection is closed. |
-
-abstract void |
-onError(WebSocket conn,
- java.lang.Exception ex)
-
-- |
-
- void |
-onMessage(WebSocket conn,
- java.lang.String message)
-
-- Called when an entire text frame has been recieved. |
-
- void |
-onOpen(WebSocket conn)
-
-- Called after onHandshakeRecieved returns true. |
-
- void |
-onWriteDemand(WebSocket conn)
-
-- |
-
- void |
-run()
-
-- |
-
- void |
-sendToAll(java.lang.String text)
-
-- Sends text to all currently connected WebSocket clients. |
-
- void |
-sendToAllExcept(java.util.Set<WebSocket> connections,
- java.lang.String text)
-
-- Sends text to all currently connected WebSocket clients, - except for those found in the Set connections. |
-
- void |
-sendToAllExcept(WebSocket connection,
- java.lang.String text)
-
-- Sends text to all currently connected WebSocket clients, - except for the specified connection. |
-
- void |
-setAddress(java.net.InetSocketAddress address)
-
-- Sets the port that this WebSocketServer should listen on. |
-
- void |
-start()
-
-- Starts the server thread that binds to the currently set port number and - listeners for WebSocket connection requests. |
-
- void |
-stop()
-
-- Closes all connected clients sockets, then closes the underlying - ServerSocketChannel, effectively killing the server socket thread and - freeing the port the server was bound to. |
-
| Methods inherited from class net.tootallnate.websocket.WebSocketAdapter | -
|---|
getFlashPolicy, onHandshakeRecievedAsClient, onHandshakeRecievedAsServer, onMessage, onPing, onPong |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public WebSocketServer() - throws java.net.UnknownHostException-
-
java.net.UnknownHostException-public WebSocketServer(java.net.InetSocketAddress address)-
-
port - The port number this server should listen on.-public WebSocketServer(java.net.InetSocketAddress address, - Draft draft)-
-
port - The port number this server should listen on.draft - The version of the WebSocket protocol that this server
- instance should comply to.| -Method Detail | -
|---|
-public void start()-
-
java.lang.IllegalStateException-public void stop() - throws java.io.IOException-
-
java.io.IOException - When socket related I/O errors occur.-public void sendToAll(java.lang.String text) - throws java.lang.InterruptedException-
-
text - The String to send across the network.
-java.io.IOException - When socket related I/O errors occur.
-java.lang.InterruptedException-public void sendToAllExcept(WebSocket connection, - java.lang.String text) - throws java.lang.InterruptedException-
-
connection - The WebSocket connection to ignore.text - The String to send to every connection except connection.
-java.io.IOException - When socket related I/O errors occur.
-java.lang.InterruptedException-public void sendToAllExcept(java.util.Set<WebSocket> connections, - java.lang.String text) - throws java.lang.InterruptedException-
-
connections - text -
-java.io.IOException - When socket related I/O errors occur.
-java.lang.InterruptedException-public java.util.Set<WebSocket> connections()-
-
-public void setAddress(java.net.InetSocketAddress address)-
-
port - The port number to listen on.-public java.net.InetSocketAddress getAddress()-
-public int getPort()-
-
-public Draft getDraft()-
-public void run()-
run in interface java.lang.Runnable-protected java.lang.String getFlashSecurityPolicy()-
-
-public void onMessage(WebSocket conn, - java.lang.String message)-
-
onMessage in class WebSocketAdapterconn - The WebSocket instance this event is occuring on.message - The UTF-8 decoded message that was recieved.-public void onOpen(WebSocket conn)-
-
onOpen in class WebSocketAdapterconn - The WebSocket instance this event is occuring on.-public void onClose(WebSocket conn)-
-
onClose in class WebSocketAdapterconn - The WebSocket instance this event is occuring on.-public void onWriteDemand(WebSocket conn)-
-public abstract void onClientOpen(WebSocket conn)-
-public abstract void onClientClose(WebSocket conn)-
-public abstract void onClientMessage(WebSocket conn, - java.lang.String message)-
-public abstract void onError(WebSocket conn, - java.lang.Exception ex)-
onError in class WebSocketAdapterconn - may be null if the error does not belong to a single connection
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.Draft -
net.tootallnate.websocket.drafts.Draft_10 -
public class Draft_10
-
| -Nested Class Summary | -
|---|
| Nested classes/interfaces inherited from class net.tootallnate.websocket.Draft | -
|---|
Draft.HandshakeState |
-
| -Field Summary | -
|---|
| Fields inherited from class net.tootallnate.websocket.Draft | -
|---|
role |
-
| -Constructor Summary | -|
|---|---|
Draft_10()
-
-- |
-|
| -Method Summary | -|
|---|---|
- Draft.HandshakeState |
-acceptHandshakeAsClient(Handshakedata request,
- Handshakedata response)
-
-- |
-
- Draft.HandshakeState |
-acceptHandshakeAsServer(Handshakedata handshakedata)
-
-- |
-
- java.nio.ByteBuffer |
-createBinaryFrame(Framedata framedata)
-
-- |
-
- java.util.List<Framedata> |
-createFrames(byte[] binary,
- boolean mask)
-
-- |
-
- java.util.List<Framedata> |
-createFrames(java.lang.String text,
- boolean mask)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeRequestAsClient(HandshakeBuilder request)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeResponseAsServer(Handshakedata request,
- HandshakeBuilder response)
-
-- |
-
-static int |
-readVersion(Handshakedata handshakedata)
-
-- |
-
- void |
-reset()
-
-- |
-
- java.util.List<Framedata> |
-translateFrame(java.nio.ByteBuffer buffer)
-
-- |
-
- Framedata |
-translateSingleFrame(java.nio.ByteBuffer buffer)
-
-- |
-
| Methods inherited from class net.tootallnate.websocket.Draft | -
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public Draft_10()-
| -Method Detail | -
|---|
-public static int readVersion(Handshakedata handshakedata)-
-public Draft.HandshakeState acceptHandshakeAsClient(Handshakedata request, - Handshakedata response) - throws InvalidHandshakeException-
acceptHandshakeAsClient in class DraftInvalidHandshakeException-public Draft.HandshakeState acceptHandshakeAsServer(Handshakedata handshakedata) - throws InvalidHandshakeException-
acceptHandshakeAsServer in class DraftInvalidHandshakeException-public java.nio.ByteBuffer createBinaryFrame(Framedata framedata)-
createBinaryFrame in class Draft-public java.util.List<Framedata> createFrames(byte[] binary, - boolean mask)-
createFrames in class Draft-public java.util.List<Framedata> createFrames(java.lang.String text, - boolean mask)-
createFrames in class Draft-public HandshakeBuilder postProcessHandshakeRequestAsClient(HandshakeBuilder request)-
postProcessHandshakeRequestAsClient in class Draft-public HandshakeBuilder postProcessHandshakeResponseAsServer(Handshakedata request, - HandshakeBuilder response) - throws InvalidHandshakeException-
postProcessHandshakeResponseAsServer in class DraftInvalidHandshakeException-public java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) - throws LimitExedeedException, - InvalidDataException-
translateFrame in class DraftLimitExedeedException
-InvalidDataException-public Framedata translateSingleFrame(java.nio.ByteBuffer buffer) - throws net.tootallnate.websocket.drafts.Draft_10.IncompleteException, - InvalidDataException-
net.tootallnate.websocket.drafts.Draft_10.IncompleteException
-InvalidDataException-public void reset()- - -
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.Draft -
net.tootallnate.websocket.drafts.Draft_10 -
net.tootallnate.websocket.drafts.Draft_17 -
public class Draft_17
-
| -Nested Class Summary | -
|---|
| Nested classes/interfaces inherited from class net.tootallnate.websocket.Draft | -
|---|
Draft.HandshakeState |
-
| -Field Summary | -
|---|
| Fields inherited from class net.tootallnate.websocket.Draft | -
|---|
role |
-
| -Constructor Summary | -|
|---|---|
Draft_17()
-
-- |
-|
| -Method Summary | -|
|---|---|
- Draft.HandshakeState |
-acceptHandshakeAsServer(Handshakedata handshakedata)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeRequestAsClient(HandshakeBuilder request)
-
-- |
-
| Methods inherited from class net.tootallnate.websocket.drafts.Draft_10 | -
|---|
acceptHandshakeAsClient, createBinaryFrame, createFrames, createFrames, postProcessHandshakeResponseAsServer, readVersion, reset, translateFrame, translateSingleFrame |
-
| Methods inherited from class net.tootallnate.websocket.Draft | -
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public Draft_17()-
| -Method Detail | -
|---|
-public Draft.HandshakeState acceptHandshakeAsServer(Handshakedata handshakedata) - throws InvalidHandshakeException-
acceptHandshakeAsServer in class Draft_10InvalidHandshakeException-public HandshakeBuilder postProcessHandshakeRequestAsClient(HandshakeBuilder request)-
postProcessHandshakeRequestAsClient in class Draft_10
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.Draft -
net.tootallnate.websocket.drafts.Draft_75 -
public class Draft_75
-
| -Nested Class Summary | -
|---|
| Nested classes/interfaces inherited from class net.tootallnate.websocket.Draft | -
|---|
Draft.HandshakeState |
-
| -Field Summary | -|
|---|---|
-static byte |
-CR
-
-- The byte representing CR, or Carriage Return, or \r |
-
-static byte |
-END_OF_FRAME
-
-- The byte representing the end of a WebSocket text frame. |
-
-static byte |
-LF
-
-- The byte representing LF, or Line Feed, or \n |
-
-static byte |
-START_OF_FRAME
-
-- The byte representing the beginning of a WebSocket text frame. |
-
| Fields inherited from class net.tootallnate.websocket.Draft | -
|---|
role |
-
| -Constructor Summary | -|
|---|---|
Draft_75()
-
-- |
-|
| -Method Summary | -|
|---|---|
- Draft.HandshakeState |
-acceptHandshakeAsClient(Handshakedata request,
- Handshakedata response)
-
-- |
-
- Draft.HandshakeState |
-acceptHandshakeAsServer(Handshakedata handshakedata)
-
-- |
-
- java.nio.ByteBuffer |
-createBinaryFrame(Framedata framedata)
-
-- |
-
- java.util.List<Framedata> |
-createFrames(byte[] binary,
- boolean mask)
-
-- |
-
- java.util.List<Framedata> |
-createFrames(java.lang.String text,
- boolean mask)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeRequestAsClient(HandshakeBuilder request)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeResponseAsServer(Handshakedata request,
- HandshakeBuilder response)
-
-- |
-
- void |
-reset()
-
-- |
-
- java.util.List<Framedata> |
-translateFrame(java.nio.ByteBuffer buffer)
-
-- |
-
| Methods inherited from class net.tootallnate.websocket.Draft | -
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Field Detail | -
|---|
-public static final byte CR-
-
-public static final byte LF-
-
-public static final byte START_OF_FRAME-
-
-public static final byte END_OF_FRAME-
-
| -Constructor Detail | -
|---|
-public Draft_75()-
| -Method Detail | -
|---|
-public Draft.HandshakeState acceptHandshakeAsClient(Handshakedata request, - Handshakedata response)-
acceptHandshakeAsClient in class Draft-public Draft.HandshakeState acceptHandshakeAsServer(Handshakedata handshakedata)-
acceptHandshakeAsServer in class Draft-public java.nio.ByteBuffer createBinaryFrame(Framedata framedata)-
createBinaryFrame in class Draft-public java.util.List<Framedata> createFrames(byte[] binary, - boolean mask)-
createFrames in class Draft-public java.util.List<Framedata> createFrames(java.lang.String text, - boolean mask)-
createFrames in class Draft-public HandshakeBuilder postProcessHandshakeRequestAsClient(HandshakeBuilder request) - throws InvalidHandshakeException-
postProcessHandshakeRequestAsClient in class DraftInvalidHandshakeException-public HandshakeBuilder postProcessHandshakeResponseAsServer(Handshakedata request, - HandshakeBuilder response) - throws InvalidHandshakeException-
postProcessHandshakeResponseAsServer in class DraftInvalidHandshakeException-public java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) - throws InvalidDataException-
translateFrame in class DraftInvalidDataException-public void reset()- - -
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
-java.lang.Object --net.tootallnate.websocket.Draft -
net.tootallnate.websocket.drafts.Draft_75 -
net.tootallnate.websocket.drafts.Draft_76 -
public class Draft_76
-
| -Nested Class Summary | -
|---|
| Nested classes/interfaces inherited from class net.tootallnate.websocket.Draft | -
|---|
Draft.HandshakeState |
-
| -Field Summary | -
|---|
| Fields inherited from class net.tootallnate.websocket.drafts.Draft_75 | -
|---|
CR, END_OF_FRAME, LF, START_OF_FRAME |
-
| Fields inherited from class net.tootallnate.websocket.Draft | -
|---|
role |
-
| -Constructor Summary | -|
|---|---|
Draft_76()
-
-- |
-|
| -Method Summary | -|
|---|---|
- Draft.HandshakeState |
-acceptHandshakeAsClient(Handshakedata request,
- Handshakedata response)
-
-- |
-
- Draft.HandshakeState |
-acceptHandshakeAsServer(Handshakedata handshakedata)
-
-- |
-
-static byte[] |
-createChallenge(java.lang.String key1,
- java.lang.String key2,
- byte[] key3)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeRequestAsClient(HandshakeBuilder request)
-
-- |
-
- HandshakeBuilder |
-postProcessHandshakeResponseAsServer(Handshakedata request,
- HandshakeBuilder response)
-
-- |
-
- Handshakedata |
-translateHandshake(java.nio.ByteBuffer buf)
-
-- |
-
| Methods inherited from class net.tootallnate.websocket.drafts.Draft_75 | -
|---|
createBinaryFrame, createFrames, createFrames, reset, translateFrame |
-
| Methods inherited from class net.tootallnate.websocket.Draft | -
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshakeHttp |
-
| Methods inherited from class java.lang.Object | -
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
-
| -Constructor Detail | -
|---|
-public Draft_76()-
| -Method Detail | -
|---|
-public static byte[] createChallenge(java.lang.String key1, - java.lang.String key2, - byte[] key3) - throws InvalidHandshakeException-
InvalidHandshakeException-public Draft.HandshakeState acceptHandshakeAsClient(Handshakedata request, - Handshakedata response)-
acceptHandshakeAsClient in class Draft_75-public Draft.HandshakeState acceptHandshakeAsServer(Handshakedata handshakedata)-
acceptHandshakeAsServer in class Draft_75-public HandshakeBuilder postProcessHandshakeRequestAsClient(HandshakeBuilder request)-
postProcessHandshakeRequestAsClient in class Draft_75-public HandshakeBuilder postProcessHandshakeResponseAsServer(Handshakedata request, - HandshakeBuilder response) - throws InvalidHandshakeException-
postProcessHandshakeResponseAsServer in class Draft_75InvalidHandshakeException-public Handshakedata translateHandshake(java.nio.ByteBuffer buf) - throws InvalidHandshakeException-
translateHandshake in class DraftInvalidHandshakeException
-
-
|
-- - | -||||||||
| - PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - - | -||||||||
| - SUMMARY: NESTED | FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -||||||||
|
-Classes
-
- -Draft_10 - -Draft_17 - -Draft_75 - -Draft_76 |
-
|
-Exceptions
-
- -IncompleteHandshakeException - -InvalidDataException - -InvalidFrameException - -InvalidHandshakeException - -LimitExedeedException |
-
|
-Interfaces
-
- -FrameBuilder - -Framedata - -HandshakeBuilder - -Handshakedata |
-
|
-Classes
-
- -Base64 - -Base64.InputStream - -Base64.OutputStream - -Charsetfunctions - -Draft - -FramedataImpl1 - -HandshakedataImpl1 - -WebSocket - -WebSocketAdapter - -WebSocketClient - -WebSocketServer |
-
|
-Enums
-
- -Draft.HandshakeState - -Framedata.Opcode - -WebSocket.Role |
-
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | ++DETAIL: ENUM CONSTANTS | FIELD | METHOD | +||||||||
+java.lang.Object ++java.lang.Enum<WebSocket.Role> +
org.java_websocket.WebSocket.Role +
public static enum WebSocket.Role
+
| +Enum Constant Summary | +|
|---|---|
CLIENT
+
++ |
+|
SERVER
+
++ |
+|
| +Method Summary | +|
|---|---|
+static WebSocket.Role |
+valueOf(java.lang.String name)
+
++ Returns the enum constant of this type with the specified name. |
+
+static WebSocket.Role[] |
+values()
+
++ Returns an array containing the constants of this enum type, in +the order they are declared. |
+
| Methods inherited from class java.lang.Enum | +
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
+
| Methods inherited from class java.lang.Object | +
|---|
getClass, notify, notifyAll, wait, wait, wait |
+
| +Enum Constant Detail | +
|---|
+public static final WebSocket.Role CLIENT+
+public static final WebSocket.Role SERVER+
| +Method Detail | +
|---|
+public static WebSocket.Role[] values()+
+for (WebSocket.Role c : WebSocket.Role.values()) + System.out.println(c); ++
+
+public static WebSocket.Role valueOf(java.lang.String name)+
+
name - the name of the enum constant to be returned.
+java.lang.IllegalArgumentException - if this enum type has no constant
+with the specified name
+java.lang.NullPointerException - if the argument is null
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | ++DETAIL: ENUM CONSTANTS | FIELD | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.WebSocket +
public final class WebSocket
+Represents one end (client or server) of a single WebSocket connection. + Takes care of the "handshake" phase, then allows for easy sending of + text frames, and receiving frames through an event-based model. + + This is an inner class, used by WebSocketClient and WebSocketServer, and should never need to be instantiated directly + by your code. However, instances are exposed in WebSocketServer through the onClientOpen, onClientClose, + onClientMessage callbacks. +
+ +
+
| +Nested Class Summary | +|
|---|---|
+static class |
+WebSocket.Role
+
++ |
+
| +Field Summary | +|
|---|---|
+static boolean |
+DEBUG
+
++ |
+
+static int |
+DEFAULT_PORT
+
++ The default port of WebSockets, as defined in the spec. |
+
+ java.util.List<Draft> |
+known_drafts
+
++ |
+
+static int |
+READY_STATE_CLOSED
+
++ |
+
+static int |
+READY_STATE_CLOSING
+
++ |
+
+static int |
+READY_STATE_CONNECTING
+
++ |
+
+static int |
+READY_STATE_OPEN
+
++ |
+
| +Constructor Summary | +|
|---|---|
WebSocket(WebSocketListener listener,
+ Draft draft,
+ java.nio.channels.SocketChannel socketchannel)
+
++ Used in WebSocketServer and WebSocketClient. |
+|
WebSocket(WebSocketListener listener,
+ java.util.List<Draft> drafts,
+ java.nio.channels.SocketChannel socketchannel)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+close(int code)
+
++ |
+
+ void |
+close(int code,
+ java.lang.String message)
+
++ sends the closing handshake. |
+
+ void |
+close(InvalidDataException e)
+
++ |
+
+ void |
+closeConnection(int code,
+ boolean remote)
+
++ |
+
+ void |
+closeConnection(int code,
+ java.lang.String message,
+ boolean remote)
+
++ closes the socket no matter if the closing handshake completed. |
+
+ void |
+closeDirect(int code,
+ java.lang.String message)
+
++ |
+
+ void |
+flush()
+
++ Empty the internal buffer, sending all the pending data before continuing. |
+
+ java.net.InetSocketAddress |
+getLocalSocketAddress()
+
++ |
+
+ int |
+getReadyState()
+
++ Retrieve the WebSocket 'readyState'. |
+
+ java.net.InetSocketAddress |
+getRemoteSocketAddress()
+
++ |
+
+ int |
+hashCode()
+
++ |
+
+ boolean |
+isClosed()
+
++ |
+
+ boolean |
+isClosing()
+
++ |
+
+ boolean |
+isConnecting()
+
++ |
+
+ Draft.HandshakeState |
+isFlashEdgeCase(java.nio.ByteBuffer request)
+
++ |
+
+ boolean |
+isOpen()
+
++ |
+
+ void |
+send(byte[] bytes)
+
++ Send Binary data (plain bytes) to the other end. |
+
+ void |
+send(java.lang.String text)
+
++ Send Text data to the other end. |
+
+ void |
+sendFrame(Framedata framedata)
+
++ |
+
+ void |
+startHandshake(ClientHandshakeBuilder handshakedata)
+
++ |
+
+ java.lang.String |
+toString()
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
+
| +Field Detail | +
|---|
+public static final int READY_STATE_CONNECTING+
+public static final int READY_STATE_OPEN+
+public static final int READY_STATE_CLOSING+
+public static final int READY_STATE_CLOSED+
+public static final int DEFAULT_PORT+
+
+public static boolean DEBUG+
+public java.util.List<Draft> known_drafts+
| +Constructor Detail | +
|---|
+public WebSocket(WebSocketListener listener, + Draft draft, + java.nio.channels.SocketChannel socketchannel)+
WebSocketServer and WebSocketClient.
++
socketchannel - The SocketChannel instance to read and
+ write to. The channel should already be registered
+ with a Selector before construction of this object.listener - The WebSocketListener to notify of events when
+ they occur.+public WebSocket(WebSocketListener listener, + java.util.List<Draft> drafts, + java.nio.channels.SocketChannel socketchannel)+
| +Method Detail | +
|---|
+public void close(int code, + java.lang.String message)+
+
+public void closeDirect(int code, + java.lang.String message) + throws java.io.IOException+
java.io.IOException+public void closeConnection(int code, + java.lang.String message, + boolean remote)+
+
remote - Indicates who "generated" code.true means that this endpoint received the code from the other endpoint.remote may also be true if this endpoint started the closing handshake since the other endpoint may not simply echo the code but close the connection the same time this endpoint does do but with an other code. +public void closeConnection(int code, + boolean remote)+
+public void close(int code)+
+public void close(InvalidDataException e)+
+public void send(java.lang.String text) + throws java.lang.IllegalArgumentException, + java.nio.channels.NotYetConnectedException, + java.lang.InterruptedException+
+
java.lang.IllegalArgumentException
+java.lang.InterruptedException
+java.nio.channels.NotYetConnectedException+public void send(byte[] bytes) + throws java.lang.IllegalArgumentException, + java.nio.channels.NotYetConnectedException, + java.lang.InterruptedException+
+
java.lang.IllegalArgumentException
+java.lang.InterruptedException
+java.nio.channels.NotYetConnectedException+public void sendFrame(Framedata framedata) + throws java.lang.InterruptedException+
java.lang.InterruptedException+public void flush() + throws java.io.IOException+
+
java.io.IOException+public Draft.HandshakeState isFlashEdgeCase(java.nio.ByteBuffer request)+
+public void startHandshake(ClientHandshakeBuilder handshakedata) + throws InvalidHandshakeException, + java.lang.InterruptedException+
InvalidHandshakeException
+java.lang.InterruptedException+public java.net.InetSocketAddress getRemoteSocketAddress()+
+public java.net.InetSocketAddress getLocalSocketAddress()+
+public boolean isConnecting()+
+public boolean isOpen()+
+public boolean isClosing()+
+public boolean isClosed()+
+public int getReadyState()+
+
+public int hashCode()+
hashCode in class java.lang.Object+public java.lang.String toString()+
toString in class java.lang.Object
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.WebSocketAdapter +
public abstract class WebSocketAdapter
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.java_websocket.WebSocketListener | +
|---|
WebSocketListener.MessageType |
+
| +Constructor Summary | +|
|---|---|
WebSocketAdapter()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+connectTiming(java.util.Date startTime,
+ java.util.Date endTime)
+
++ This default implementation does not do anything. |
+
+ java.lang.String |
+getFlashPolicy(WebSocket conn)
+
++ Gets the XML string that should be returned if a client requests a Flash + security policy. |
+
+ void |
+messageReceiveTiming(java.util.Date startTime,
+ java.util.Date endTime,
+ WebSocketListener.MessageType type,
+ int bytesAmount)
+
++ This default implementation does not do anything. |
+
+ void |
+messageSendTiming(java.util.Date startTime,
+ java.util.Date endTime,
+ WebSocketListener.MessageType type,
+ int bytesAmount)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketClose(WebSocket conn,
+ int code,
+ java.lang.String reason,
+ boolean remote)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketError(WebSocket conn,
+ java.lang.Exception ex)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketHandshakeReceivedAsClient(WebSocket conn,
+ ClientHandshake request,
+ ServerHandshake response)
+
++ This default implementation does not do anything which will cause connections to be accepted. |
+
+ ServerHandshakeBuilder |
+onWebsocketHandshakeReceivedAsServer(WebSocket conn,
+ Draft draft,
+ ClientHandshake request)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketHandshakeSentAsClient(WebSocket conn,
+ ClientHandshake request)
+
++ This default implementation does not do anything which will cause the connections to always progress. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ byte[] blob)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ java.lang.String message)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketOpen(WebSocket conn,
+ Handshakedata handshake)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketPing(WebSocket conn,
+ Framedata f)
+
++ This default implementation will send a pong in response to the received ping. |
+
+ void |
+onWebsocketPong(WebSocket conn,
+ Framedata f)
+
++ This default implementation does not do anything. |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| Methods inherited from interface org.java_websocket.WebSocketListener | +
|---|
onWriteDemand |
+
| +Constructor Detail | +
|---|
+public WebSocketAdapter()+
| +Method Detail | +
|---|
+public ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(WebSocket conn, + Draft draft, + ClientHandshake request) + throws InvalidDataException+
+
onWebsocketHandshakeReceivedAsServer in interface WebSocketListenerconn - The WebSocket related to this eventdraft - The protocol draft the client uses to connectrequest - The opening http message send by the client. Can be used to access additional fields like cookies.
+InvalidDataException - Throwing this exception will cause this handshake to be rejectedWebSocketListener.onWebsocketHandshakeReceivedAsServer(WebSocket, Draft, ClientHandshake)+public void onWebsocketHandshakeReceivedAsClient(WebSocket conn, + ClientHandshake request, + ServerHandshake response) + throws InvalidDataException+
+
onWebsocketHandshakeReceivedAsClient in interface WebSocketListenerconn - The WebSocket related to this eventrequest - The handshake initially send out to the server by this websocket.response - The handshake the server sent in response to the request.
+InvalidDataException - Allows the client to reject the connection with the server in respect of its handshake response.WebSocketListener.onWebsocketHandshakeReceivedAsClient(WebSocket, ClientHandshake, ServerHandshake)+public void onWebsocketHandshakeSentAsClient(WebSocket conn, + ClientHandshake request) + throws InvalidDataException+
+
onWebsocketHandshakeSentAsClient in interface WebSocketListenerconn - The WebSocket related to this eventrequest - The handshake sent to the server by this websocket
+InvalidDataException - Allows the client to stop the connection from progressingWebSocketListener.onWebsocketHandshakeSentAsClient(WebSocket, ClientHandshake)+public void onWebsocketMessage(WebSocket conn, + java.lang.String message)+
+
onWebsocketMessage in interface WebSocketListenerconn - The WebSocket instance this event is occurring on.message - The UTF-8 decoded message that was received.WebSocketListener.onWebsocketMessage(WebSocket, String)+public void onWebsocketOpen(WebSocket conn, + Handshakedata handshake)+
+
onWebsocketOpen in interface WebSocketListenerconn - The WebSocket instance this event is occuring on.WebSocketListener.onWebsocketOpen(WebSocket, Handshakedata)+public void onWebsocketClose(WebSocket conn, + int code, + java.lang.String reason, + boolean remote)+
+
onWebsocketClose in interface WebSocketListenerconn - The WebSocket instance this event is occuring on.WebSocketListener.onWebsocketClose(WebSocket, int, String, boolean)+public void onWebsocketMessage(WebSocket conn, + byte[] blob)+
+
onWebsocketMessage in interface WebSocketListenerconn - The WebSocket instance this event is occurring on.blob - The binary message that was received.WebSocketListener.onWebsocketMessage(WebSocket, byte[])+public void onWebsocketPing(WebSocket conn, + Framedata f)+
+
onWebsocketPing in interface WebSocketListenerf - The ping frame. Control frames may contain payload.WebSocketListener.onWebsocketPing(WebSocket, Framedata)+public void onWebsocketPong(WebSocket conn, + Framedata f)+
+
onWebsocketPong in interface WebSocketListener+public java.lang.String getFlashPolicy(WebSocket conn)+
+
getFlashPolicy in interface WebSocketListener+public void onWebsocketError(WebSocket conn, + java.lang.Exception ex)+
+
onWebsocketError in interface WebSocketListenerex - The exception that occurred. WebSocketListener.onWebsocketError(WebSocket, Exception)+public void connectTiming(java.util.Date startTime, + java.util.Date endTime)+
+
connectTiming in interface WebSocketListenerstartTime - Time at which the socket started connectingendTime - Time at which the socket connection was establishedWebSocketListener.connectTiming(Date startTime, Date endTime)+public void messageSendTiming(java.util.Date startTime, + java.util.Date endTime, + WebSocketListener.MessageType type, + int bytesAmount)+
+
messageSendTiming in interface WebSocketListenerstartTime - Time at which it started sending a messageendTime - Time at which if finished sending that messagetype - Type of message sentbytesAmount - Amount of bytes sentWebSocketListener.messageSendTiming(Date startTime, Date endTime, MessageType type, int bytesAmount)+public void messageReceiveTiming(java.util.Date startTime, + java.util.Date endTime, + WebSocketListener.MessageType type, + int bytesAmount)+
+
messageReceiveTiming in interface WebSocketListenerstartTime - Time at which it started receiving a messageendTime - Time at which if finished receiving that messagetype - Type of message sentbytesAmount - Amount of bytes receivedWebSocketListener.messageReceiveTiming(Date startTime, Date endTime, MessageType type, int bytesAmount)
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.WebSocketAdapter +
org.java_websocket.WebSocketClient +
public abstract class WebSocketClient
+The WebSocketClient is an abstract class that expects a valid + "ws://" URI to connect to. When connected, an instance recieves important + events related to the life of the connection. A subclass must implement + onOpen, onClose, and onMessage to be + useful. An instance can send messages to it's connected server via the + send method. +
+ +
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.java_websocket.WebSocketListener | +
|---|
WebSocketListener.MessageType |
+
| +Constructor Summary | +|
|---|---|
WebSocketClient(java.net.URI serverURI)
+
++ |
+|
WebSocketClient(java.net.URI serverUri,
+ Draft draft)
+
++ Constructs a WebSocketClient instance and sets it to the connect to the + specified URI. |
+|
| +Method Summary | +|
|---|---|
+ void |
+close()
+
++ |
+
+ void |
+connect()
+
++ Starts a background thread that attempts and maintains a WebSocket + connection to the URI specified in the constructor or via setURI. |
+
+ void |
+flush()
+
++ |
+
+ long |
+getBufferedAmount()
+
++ Amount of data buffered/queued but not sent yet. |
+
+ WebSocket |
+getConnection()
+
++ |
+
+ Draft |
+getDraft()
+
++ Returns the protocol version this client uses. |
+
+ int |
+getReadyState()
+
++ Retrieve the WebSocket 'readyState'. |
+
+ java.net.URI |
+getURI()
+
++ Gets the URI that this WebSocketClient is connected to. |
+
+protected void |
+interruptableRun()
+
++ |
+
+abstract void |
+onClose(int code,
+ java.lang.String reason,
+ boolean remote)
+
++ |
+
+abstract void |
+onError(java.lang.Exception ex)
+
++ |
+
+ void |
+onMessage(byte[] bytes)
+
++ |
+
+abstract void |
+onMessage(java.lang.String message)
+
++ |
+
+abstract void |
+onOpen(ServerHandshake handshakedata)
+
++ |
+
+ void |
+onWebsocketClose(WebSocket conn,
+ int code,
+ java.lang.String reason,
+ boolean remote)
+
++ Calls subclass' implementation of onClose. |
+
+ void |
+onWebsocketError(WebSocket conn,
+ java.lang.Exception ex)
+
++ Calls subclass' implementation of onIOError. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ byte[] blob)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ java.lang.String message)
+
++ Calls subclass' implementation of onMessage. |
+
+ void |
+onWebsocketOpen(WebSocket conn,
+ Handshakedata handshake)
+
++ Calls subclass' implementation of onOpen. |
+
+ void |
+onWriteDemand(WebSocket conn)
+
++ This method is used to inform the selector thread that there is data queued to be written to the socket. |
+
+ void |
+run()
+
++ |
+
+ void |
+send(byte[] data)
+
++ Sends data to the connected WebSocket server. |
+
+ void |
+send(java.lang.String text)
+
++ Sends text to the connected WebSocket server. |
+
| Methods inherited from class org.java_websocket.WebSocketAdapter | +
|---|
connectTiming, getFlashPolicy, messageReceiveTiming, messageSendTiming, onWebsocketHandshakeReceivedAsClient, onWebsocketHandshakeReceivedAsServer, onWebsocketHandshakeSentAsClient, onWebsocketPing, onWebsocketPong |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public WebSocketClient(java.net.URI serverURI)+
+public WebSocketClient(java.net.URI serverUri, + Draft draft)+
+
| +Method Detail | +
|---|
+public java.net.URI getURI()+
+
+public Draft getDraft()+
+
+public void connect()+
+
+public void close()+
+public void send(java.lang.String text) + throws java.nio.channels.NotYetConnectedException, + java.lang.InterruptedException+
+
text - The String to send to the WebSocket server.
+java.nio.channels.NotYetConnectedException
+java.lang.InterruptedException+public void send(byte[] data) + throws java.nio.channels.NotYetConnectedException, + java.lang.InterruptedException+
+
data - The Byte-Array of data to send to the WebSocket server.
+java.nio.channels.NotYetConnectedException
+java.lang.InterruptedException+public void run()+
run in interface java.lang.Runnable+protected final void interruptableRun()+
+public void flush()+
+public int getReadyState()+
+
+public long getBufferedAmount()+
+
+public final void onWebsocketMessage(WebSocket conn, + java.lang.String message)+
+
onWebsocketMessage in interface WebSocketListeneronWebsocketMessage in class WebSocketAdapterconn - message - WebSocketListener.onWebsocketMessage(WebSocket, String)+public final void onWebsocketMessage(WebSocket conn, + byte[] blob)+
WebSocketAdapter+
onWebsocketMessage in interface WebSocketListeneronWebsocketMessage in class WebSocketAdapterconn - The WebSocket instance this event is occurring on.blob - The binary message that was received.WebSocketListener.onWebsocketMessage(WebSocket, byte[])+public final void onWebsocketOpen(WebSocket conn, + Handshakedata handshake)+
+
onWebsocketOpen in interface WebSocketListeneronWebsocketOpen in class WebSocketAdapterconn - WebSocketListener.onWebsocketOpen(WebSocket, Handshakedata)+public final void onWebsocketClose(WebSocket conn, + int code, + java.lang.String reason, + boolean remote)+
+
onWebsocketClose in interface WebSocketListeneronWebsocketClose in class WebSocketAdapterconn - WebSocketListener.onWebsocketClose(WebSocket, int, String, boolean)+public final void onWebsocketError(WebSocket conn, + java.lang.Exception ex)+
+
onWebsocketError in interface WebSocketListeneronWebsocketError in class WebSocketAdapterconn - ex - The exception that occurred. WebSocketListener.onWebsocketError(WebSocket, Exception)+public final void onWriteDemand(WebSocket conn)+
WebSocketListener+
onWriteDemand in interface WebSocketListener+public WebSocket getConnection()+
+public abstract void onOpen(ServerHandshake handshakedata)+
+public abstract void onMessage(java.lang.String message)+
+public abstract void onClose(int code, + java.lang.String reason, + boolean remote)+
+public abstract void onError(java.lang.Exception ex)+
+public void onMessage(byte[] bytes)+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | ++DETAIL: ENUM CONSTANTS | FIELD | METHOD | +||||||||
+java.lang.Object ++java.lang.Enum<WebSocketListener.MessageType> +
org.java_websocket.WebSocketListener.MessageType +
public static enum WebSocketListener.MessageType
+
| +Enum Constant Summary | +|
|---|---|
BINARY
+
++ |
+|
CLOSE
+
++ |
+|
HANDSHAKE
+
++ |
+|
TEXT
+
++ |
+|
| +Method Summary | +|
|---|---|
+static WebSocketListener.MessageType |
+valueOf(java.lang.String name)
+
++ Returns the enum constant of this type with the specified name. |
+
+static WebSocketListener.MessageType[] |
+values()
+
++ Returns an array containing the constants of this enum type, in +the order they are declared. |
+
| Methods inherited from class java.lang.Enum | +
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
+
| Methods inherited from class java.lang.Object | +
|---|
getClass, notify, notifyAll, wait, wait, wait |
+
| +Enum Constant Detail | +
|---|
+public static final WebSocketListener.MessageType HANDSHAKE+
+public static final WebSocketListener.MessageType CLOSE+
+public static final WebSocketListener.MessageType TEXT+
+public static final WebSocketListener.MessageType BINARY+
| +Method Detail | +
|---|
+public static WebSocketListener.MessageType[] values()+
+for (WebSocketListener.MessageType c : WebSocketListener.MessageType.values()) + System.out.println(c); ++
+
+public static WebSocketListener.MessageType valueOf(java.lang.String name)+
+
name - the name of the enum constant to be returned.
+java.lang.IllegalArgumentException - if this enum type has no constant
+with the specified name
+java.lang.NullPointerException - if the argument is null
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | ++DETAIL: ENUM CONSTANTS | FIELD | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
public interface WebSocketListener
+Implemented by WebSocketClient and WebSocketServer. + The methods within are called by WebSocket. + Almost every method takes a first parameter conn which represents the source of the respective event. +
+ +
+
| +Nested Class Summary | +|
|---|---|
+static class |
+WebSocketListener.MessageType
+
++ |
+
| +Method Summary | +|
|---|---|
+ void |
+connectTiming(java.util.Date startTime,
+ java.util.Date endTime)
+
++ Informs the Listener how long it took to open a socket connection |
+
+ java.lang.String |
+getFlashPolicy(WebSocket conn)
+
++ Gets the XML string that should be returned if a client requests a Flash + security policy. |
+
+ void |
+messageReceiveTiming(java.util.Date startTime,
+ java.util.Date endTime,
+ WebSocketListener.MessageType type,
+ int bytesAmount)
+
++ Informs the Listener how long it took to receive a Message. |
+
+ void |
+messageSendTiming(java.util.Date startTime,
+ java.util.Date endTime,
+ WebSocketListener.MessageType type,
+ int bytesAmount)
+
++ Informs the Listener how long it took to send a Message. |
+
+ void |
+onWebsocketClose(WebSocket conn,
+ int code,
+ java.lang.String reason,
+ boolean remote)
+
++ Called after WebSocket#close is explicity called, or when the + other end of the WebSocket connection is closed. |
+
+ void |
+onWebsocketError(WebSocket conn,
+ java.lang.Exception ex)
+
++ Called if an exception worth noting occurred. |
+
+ void |
+onWebsocketHandshakeReceivedAsClient(WebSocket conn,
+ ClientHandshake request,
+ ServerHandshake response)
+
++ Called on the client side when the socket connection is first established, and the WebSocket + handshake response has been received. |
+
+ ServerHandshakeBuilder |
+onWebsocketHandshakeReceivedAsServer(WebSocket conn,
+ Draft draft,
+ ClientHandshake request)
+
++ Called on the server side when the socket connection is first established, and the WebSocket + handshake has been received. |
+
+ void |
+onWebsocketHandshakeSentAsClient(WebSocket conn,
+ ClientHandshake request)
+
++ Called on the client side when the socket connection is first established, and the WebSocket + handshake has just been sent. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ byte[] blob)
+
++ Called when an entire binary frame has been received. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ java.lang.String message)
+
++ Called when an entire text frame has been received. |
+
+ void |
+onWebsocketOpen(WebSocket conn,
+ Handshakedata d)
+
++ Called after onHandshakeReceived returns true. |
+
+ void |
+onWebsocketPing(WebSocket conn,
+ Framedata f)
+
++ Called a ping frame has been received. |
+
+ void |
+onWebsocketPong(WebSocket conn,
+ Framedata f)
+
++ Called when a pong frame is received. |
+
+ void |
+onWriteDemand(WebSocket conn)
+
++ This method is used to inform the selector thread that there is data queued to be written to the socket. |
+
| +Method Detail | +
|---|
+ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(WebSocket conn, + Draft draft, + ClientHandshake request) + throws InvalidDataException+
+
conn - The WebSocket related to this eventdraft - The protocol draft the client uses to connectrequest - The opening http message send by the client. Can be used to access additional fields like cookies.
+InvalidDataException - Throwing this exception will cause this handshake to be rejected+void onWebsocketHandshakeReceivedAsClient(WebSocket conn, + ClientHandshake request, + ServerHandshake response) + throws InvalidDataException+
+
conn - The WebSocket related to this eventrequest - The handshake initially send out to the server by this websocket.response - The handshake the server sent in response to the request.
+InvalidDataException - Allows the client to reject the connection with the server in respect of its handshake response.+void onWebsocketHandshakeSentAsClient(WebSocket conn, + ClientHandshake request) + throws InvalidDataException+
+
conn - The WebSocket related to this eventrequest - The handshake sent to the server by this websocket
+InvalidDataException - Allows the client to stop the connection from progressing+void onWebsocketMessage(WebSocket conn, + java.lang.String message)+
+
conn - The WebSocket instance this event is occurring on.message - The UTF-8 decoded message that was received.+void onWebsocketMessage(WebSocket conn, + byte[] blob)+
+
conn - The WebSocket instance this event is occurring on.blob - The binary message that was received.+void onWebsocketOpen(WebSocket conn, + Handshakedata d)+
+
conn - The WebSocket instance this event is occuring on.+void onWebsocketClose(WebSocket conn, + int code, + java.lang.String reason, + boolean remote)+
+
conn - The WebSocket instance this event is occuring on.+void onWebsocketError(WebSocket conn, + java.lang.Exception ex)+
+
ex - The exception that occurred. +void onWebsocketPing(WebSocket conn, + Framedata f)+
+
f - The ping frame. Control frames may contain payload.+void onWebsocketPong(WebSocket conn, + Framedata f)+
+
+java.lang.String getFlashPolicy(WebSocket conn)+
+
+void onWriteDemand(WebSocket conn)+
+
+void connectTiming(java.util.Date startTime, + java.util.Date endTime)+
+
startTime - Time at which the socket started connectingendTime - Time at which the socket connection was established+void messageSendTiming(java.util.Date startTime, + java.util.Date endTime, + WebSocketListener.MessageType type, + int bytesAmount)+
+
startTime - Time at which it started sending a messageendTime - Time at which if finished sending that messagetype - Type of message sentbytesAmount - Amount of bytes sent+void messageReceiveTiming(java.util.Date startTime, + java.util.Date endTime, + WebSocketListener.MessageType type, + int bytesAmount)+
+
startTime - Time at which it started receiving a messageendTime - Time at which if finished receiving that messagetype - Type of message sentbytesAmount - Amount of bytes received
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.WebSocketAdapter +
org.java_websocket.WebSocketServer +
public abstract class WebSocketServer
+WebSocketServer is an abstract class that only takes care of the + HTTP handshake portion of WebSockets. It's up to a subclass to add + functionality/purpose to the server. +
+ +
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.java_websocket.WebSocketListener | +
|---|
WebSocketListener.MessageType |
+
| +Constructor Summary | +|
|---|---|
WebSocketServer()
+
++ Nullary constructor. |
+|
WebSocketServer(java.net.InetSocketAddress address)
+
++ Creates a WebSocketServer that will attempt to bind/listen on the given address. |
+|
WebSocketServer(java.net.InetSocketAddress address,
+ Draft draft)
+
++ Creates a WebSocketServer that will attempt to bind/listen on the given address, + and comply with Draft version draft. |
+|
| +Method Summary | +|
|---|---|
+ java.util.Set<WebSocket> |
+connections()
+
++ Returns a WebSocket[] of currently connected clients. |
+
+ java.net.InetSocketAddress |
+getAddress()
+
++ |
+
+ Draft |
+getDraft()
+
++ |
+
+protected java.lang.String |
+getFlashSecurityPolicy()
+
++ Gets the XML string that should be returned if a client requests a Flash + security policy. |
+
+ int |
+getPort()
+
++ Gets the port number that this server listens on. |
+
+abstract void |
+onClose(WebSocket conn,
+ int code,
+ java.lang.String reason,
+ boolean remote)
+
++ |
+
+abstract void |
+onError(WebSocket conn,
+ java.lang.Exception ex)
+
++ |
+
+ void |
+onMessage(WebSocket conn,
+ byte[] message)
+
++ |
+
+abstract void |
+onMessage(WebSocket conn,
+ java.lang.String message)
+
++ |
+
+abstract void |
+onOpen(WebSocket conn,
+ ClientHandshake handshake)
+
++ |
+
+ void |
+onWebsocketClose(WebSocket conn,
+ int code,
+ java.lang.String reason,
+ boolean remote)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketError(WebSocket conn,
+ java.lang.Exception ex)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ byte[] blob)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketMessage(WebSocket conn,
+ java.lang.String message)
+
++ This default implementation does not do anything. |
+
+ void |
+onWebsocketOpen(WebSocket conn,
+ Handshakedata handshake)
+
++ This default implementation does not do anything. |
+
+ void |
+onWriteDemand(WebSocket conn)
+
++ This method is used to inform the selector thread that there is data queued to be written to the socket. |
+
+ void |
+run()
+
++ |
+
+ void |
+setAddress(java.net.InetSocketAddress address)
+
++ Sets the address (host:port) that this WebSocketServer should listen on. |
+
+ void |
+start()
+
++ Starts the server thread that binds to the currently set port number and + listeners for WebSocket connection requests. |
+
+ void |
+stop()
+
++ Closes all connected clients sockets, then closes the underlying + ServerSocketChannel, effectively killing the server socket thread and + freeing the port the server was bound to. |
+
| Methods inherited from class org.java_websocket.WebSocketAdapter | +
|---|
connectTiming, getFlashPolicy, messageReceiveTiming, messageSendTiming, onWebsocketHandshakeReceivedAsClient, onWebsocketHandshakeReceivedAsServer, onWebsocketHandshakeSentAsClient, onWebsocketPing, onWebsocketPong |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public WebSocketServer() + throws java.net.UnknownHostException+
+
java.net.UnknownHostException+public WebSocketServer(java.net.InetSocketAddress address)+
+
address - The address (host:port) this server should listen on.+public WebSocketServer(java.net.InetSocketAddress address, + Draft draft)+
+
address - The address (host:port) this server should listen on.draft - The version of the WebSocket protocol that this server
+ instance should comply to.| +Method Detail | +
|---|
+public void start()+
+
java.lang.IllegalStateException+public void stop() + throws java.io.IOException+
+
java.io.IOException - When socket related I/O errors occur.+public java.util.Set<WebSocket> connections()+
+
+public void setAddress(java.net.InetSocketAddress address)+
+
address - The address (host:port) to listen on.+public java.net.InetSocketAddress getAddress()+
+public int getPort()+
+
+public Draft getDraft()+
+public void run()+
run in interface java.lang.Runnable+protected java.lang.String getFlashSecurityPolicy()+
+
+public final void onWebsocketMessage(WebSocket conn, + java.lang.String message)+
WebSocketAdapter+
onWebsocketMessage in interface WebSocketListeneronWebsocketMessage in class WebSocketAdapterconn - The WebSocket instance this event is occurring on.message - The UTF-8 decoded message that was received.WebSocketListener.onWebsocketMessage(WebSocket, String)+public final void onWebsocketMessage(WebSocket conn, + byte[] blob)+
WebSocketAdapter+
onWebsocketMessage in interface WebSocketListeneronWebsocketMessage in class WebSocketAdapterconn - The WebSocket instance this event is occurring on.blob - The binary message that was received.WebSocketListener.onWebsocketMessage(WebSocket, byte[])+public final void onWebsocketOpen(WebSocket conn, + Handshakedata handshake)+
WebSocketAdapter+
onWebsocketOpen in interface WebSocketListeneronWebsocketOpen in class WebSocketAdapterconn - The WebSocket instance this event is occuring on.WebSocketListener.onWebsocketOpen(WebSocket, Handshakedata)+public final void onWebsocketClose(WebSocket conn, + int code, + java.lang.String reason, + boolean remote)+
WebSocketAdapter+
onWebsocketClose in interface WebSocketListeneronWebsocketClose in class WebSocketAdapterconn - The WebSocket instance this event is occuring on.WebSocketListener.onWebsocketClose(WebSocket, int, String, boolean)+public final void onWebsocketError(WebSocket conn, + java.lang.Exception ex)+
WebSocketAdapter+
onWebsocketError in interface WebSocketListeneronWebsocketError in class WebSocketAdapterconn - may be null if the error does not belong to a single connectionex - The exception that occurred. WebSocketListener.onWebsocketError(WebSocket, Exception)+public final void onWriteDemand(WebSocket conn)+
WebSocketListener+
onWriteDemand in interface WebSocketListener+public abstract void onOpen(WebSocket conn, + ClientHandshake handshake)+
+public abstract void onClose(WebSocket conn, + int code, + java.lang.String reason, + boolean remote)+
+public abstract void onMessage(WebSocket conn, + java.lang.String message)+
+public abstract void onError(WebSocket conn, + java.lang.Exception ex)+
+public void onMessage(WebSocket conn, + byte[] message)+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++ +org.java_websocket.drafts.Draft +
public abstract class Draft
+Base class for everything of a websocket specification which is not common such as the way the handshake is read or frames are transfered. +
+ +
+
| +Nested Class Summary | +|
|---|---|
+static class |
+Draft.CloseHandshakeType
+
++ |
+
+static class |
+Draft.HandshakeState
+
++ |
+
| +Field Summary | +|
|---|---|
+static byte[] |
+FLASH_POLICY_REQUEST
+
++ |
+
+protected WebSocket.Role |
+role
+
++ In some cases the handshake will be parsed different depending on whether |
+
| +Constructor Summary | +|
|---|---|
Draft()
+
++ |
+|
| +Method Summary | +|
|---|---|
+abstract Draft.HandshakeState |
+acceptHandshakeAsClient(ClientHandshake request,
+ ServerHandshake response)
+
++ |
+
+abstract Draft.HandshakeState |
+acceptHandshakeAsServer(ClientHandshake handshakedata)
+
++ |
+
+protected boolean |
+basicAccept(Handshakedata handshakedata)
+
++ |
+
+ int |
+checkAlloc(int bytecount)
+
++ |
+
+abstract java.nio.ByteBuffer |
+createBinaryFrame(Framedata framedata)
+
++ |
+
+abstract java.util.List<Framedata> |
+createFrames(byte[] binary,
+ boolean mask)
+
++ |
+
+abstract java.util.List<Framedata> |
+createFrames(java.lang.String text,
+ boolean mask)
+
++ |
+
+ java.util.List<java.nio.ByteBuffer> |
+createHandshake(Handshakedata handshakedata,
+ WebSocket.Role ownrole)
+
++ |
+
+ java.util.List<java.nio.ByteBuffer> |
+createHandshake(Handshakedata handshakedata,
+ WebSocket.Role ownrole,
+ boolean withcontent)
+
++ |
+
+abstract Draft.CloseHandshakeType |
+getCloseHandshakeType()
+
++ |
+
+abstract ClientHandshakeBuilder |
+postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
+
++ |
+
+abstract HandshakeBuilder |
+postProcessHandshakeResponseAsServer(ClientHandshake request,
+ ServerHandshakeBuilder response)
+
++ |
+
+static java.nio.ByteBuffer |
+readLine(java.nio.ByteBuffer buf)
+
++ |
+
+static java.lang.String |
+readStringLine(java.nio.ByteBuffer buf)
+
++ |
+
+abstract void |
+reset()
+
++ |
+
+ void |
+setParseMode(WebSocket.Role role)
+
++ |
+
+abstract java.util.List<Framedata> |
+translateFrame(java.nio.ByteBuffer buffer)
+
++ |
+
+ Handshakedata |
+translateHandshake(java.nio.ByteBuffer buf)
+
++ |
+
+static HandshakeBuilder |
+translateHandshakeHttp(java.nio.ByteBuffer buf,
+ WebSocket.Role role)
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Field Detail | +
|---|
+public static final byte[] FLASH_POLICY_REQUEST+
+protected WebSocket.Role role+
+
| +Constructor Detail | +
|---|
+public Draft()+
| +Method Detail | +
|---|
+public static java.nio.ByteBuffer readLine(java.nio.ByteBuffer buf)+
+public static java.lang.String readStringLine(java.nio.ByteBuffer buf)+
+public static HandshakeBuilder translateHandshakeHttp(java.nio.ByteBuffer buf, + WebSocket.Role role) + throws InvalidHandshakeException+
InvalidHandshakeException+public abstract Draft.HandshakeState acceptHandshakeAsClient(ClientHandshake request, + ServerHandshake response) + throws InvalidHandshakeException+
InvalidHandshakeException+public abstract Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata) + throws InvalidHandshakeException+
InvalidHandshakeException+protected boolean basicAccept(Handshakedata handshakedata)+
+public abstract java.nio.ByteBuffer createBinaryFrame(Framedata framedata)+
+public abstract java.util.List<Framedata> createFrames(byte[] binary, + boolean mask)+
+public abstract java.util.List<Framedata> createFrames(java.lang.String text, + boolean mask)+
+public abstract void reset()+
+public java.util.List<java.nio.ByteBuffer> createHandshake(Handshakedata handshakedata, + WebSocket.Role ownrole)+
+public java.util.List<java.nio.ByteBuffer> createHandshake(Handshakedata handshakedata, + WebSocket.Role ownrole, + boolean withcontent)+
+public abstract ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request) + throws InvalidHandshakeException+
InvalidHandshakeException+public abstract HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, + ServerHandshakeBuilder response) + throws InvalidHandshakeException+
InvalidHandshakeException+public abstract java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) + throws InvalidDataException+
InvalidDataException+public Handshakedata translateHandshake(java.nio.ByteBuffer buf) + throws InvalidHandshakeException+
InvalidHandshakeException+public int checkAlloc(int bytecount) + throws LimitExedeedException, + InvalidDataException+
LimitExedeedException
+InvalidDataException+public void setParseMode(WebSocket.Role role)+
+public abstract Draft.CloseHandshakeType getCloseHandshakeType()+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.drafts.Draft +
org.java_websocket.drafts.Draft_10 +
public class Draft_10
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from class org.java_websocket.drafts.Draft | +
|---|
Draft.CloseHandshakeType, Draft.HandshakeState |
+
| +Field Summary | +
|---|
| Fields inherited from class org.java_websocket.drafts.Draft | +
|---|
FLASH_POLICY_REQUEST, role |
+
| +Constructor Summary | +|
|---|---|
Draft_10()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ Draft.HandshakeState |
+acceptHandshakeAsClient(ClientHandshake request,
+ ServerHandshake response)
+
++ |
+
+ Draft.HandshakeState |
+acceptHandshakeAsServer(ClientHandshake handshakedata)
+
++ |
+
+ java.nio.ByteBuffer |
+createBinaryFrame(Framedata framedata)
+
++ |
+
+ java.util.List<Framedata> |
+createFrames(byte[] binary,
+ boolean mask)
+
++ |
+
+ java.util.List<Framedata> |
+createFrames(java.lang.String text,
+ boolean mask)
+
++ |
+
+ Draft.CloseHandshakeType |
+getCloseHandshakeType()
+
++ |
+
+ ClientHandshakeBuilder |
+postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
+
++ |
+
+ HandshakeBuilder |
+postProcessHandshakeResponseAsServer(ClientHandshake request,
+ ServerHandshakeBuilder response)
+
++ |
+
+static int |
+readVersion(Handshakedata handshakedata)
+
++ |
+
+ void |
+reset()
+
++ |
+
+ java.util.List<Framedata> |
+translateFrame(java.nio.ByteBuffer buffer)
+
++ |
+
+ Framedata |
+translateSingleFrame(java.nio.ByteBuffer buffer)
+
++ |
+
| Methods inherited from class org.java_websocket.drafts.Draft | +
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public Draft_10()+
| +Method Detail | +
|---|
+public static int readVersion(Handshakedata handshakedata)+
+public Draft.HandshakeState acceptHandshakeAsClient(ClientHandshake request, + ServerHandshake response) + throws InvalidHandshakeException+
acceptHandshakeAsClient in class DraftInvalidHandshakeException+public Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata) + throws InvalidHandshakeException+
acceptHandshakeAsServer in class DraftInvalidHandshakeException+public java.nio.ByteBuffer createBinaryFrame(Framedata framedata)+
createBinaryFrame in class Draft+public java.util.List<Framedata> createFrames(byte[] binary, + boolean mask)+
createFrames in class Draft+public java.util.List<Framedata> createFrames(java.lang.String text, + boolean mask)+
createFrames in class Draft+public ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)+
postProcessHandshakeRequestAsClient in class Draft+public HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, + ServerHandshakeBuilder response) + throws InvalidHandshakeException+
postProcessHandshakeResponseAsServer in class DraftInvalidHandshakeException+public java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) + throws LimitExedeedException, + InvalidDataException+
translateFrame in class DraftLimitExedeedException
+InvalidDataException+public Framedata translateSingleFrame(java.nio.ByteBuffer buffer) + throws org.java_websocket.drafts.Draft_10.IncompleteException, + InvalidDataException+
org.java_websocket.drafts.Draft_10.IncompleteException
+InvalidDataException+public void reset()+ +
+public Draft.CloseHandshakeType getCloseHandshakeType()+
getCloseHandshakeType in class Draft
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.drafts.Draft +
org.java_websocket.drafts.Draft_10 +
org.java_websocket.drafts.Draft_17 +
public class Draft_17
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from class org.java_websocket.drafts.Draft | +
|---|
Draft.CloseHandshakeType, Draft.HandshakeState |
+
| +Field Summary | +
|---|
| Fields inherited from class org.java_websocket.drafts.Draft | +
|---|
FLASH_POLICY_REQUEST, role |
+
| +Constructor Summary | +|
|---|---|
Draft_17()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ Draft.HandshakeState |
+acceptHandshakeAsServer(ClientHandshake handshakedata)
+
++ |
+
+ ClientHandshakeBuilder |
+postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
+
++ |
+
| Methods inherited from class org.java_websocket.drafts.Draft_10 | +
|---|
acceptHandshakeAsClient, createBinaryFrame, createFrames, createFrames, getCloseHandshakeType, postProcessHandshakeResponseAsServer, readVersion, reset, translateFrame, translateSingleFrame |
+
| Methods inherited from class org.java_websocket.drafts.Draft | +
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public Draft_17()+
| +Method Detail | +
|---|
+public Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata) + throws InvalidHandshakeException+
acceptHandshakeAsServer in class Draft_10InvalidHandshakeException+public ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)+
postProcessHandshakeRequestAsClient in class Draft_10
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.drafts.Draft +
org.java_websocket.drafts.Draft_75 +
public class Draft_75
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from class org.java_websocket.drafts.Draft | +
|---|
Draft.CloseHandshakeType, Draft.HandshakeState |
+
| +Field Summary | +|
|---|---|
+static byte |
+CR
+
++ The byte representing CR, or Carriage Return, or \r |
+
+protected java.nio.ByteBuffer |
+currentFrame
+
++ |
+
+static byte |
+END_OF_FRAME
+
++ The byte representing the end of a WebSocket text frame. |
+
+static byte |
+LF
+
++ The byte representing LF, or Line Feed, or \n |
+
+protected boolean |
+readingState
+
++ |
+
+protected java.util.List<Framedata> |
+readyframes
+
++ |
+
+static byte |
+START_OF_FRAME
+
++ The byte representing the beginning of a WebSocket text frame. |
+
| Fields inherited from class org.java_websocket.drafts.Draft | +
|---|
FLASH_POLICY_REQUEST, role |
+
| +Constructor Summary | +|
|---|---|
Draft_75()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ Draft.HandshakeState |
+acceptHandshakeAsClient(ClientHandshake request,
+ ServerHandshake response)
+
++ |
+
+ Draft.HandshakeState |
+acceptHandshakeAsServer(ClientHandshake handshakedata)
+
++ |
+
+ java.nio.ByteBuffer |
+createBinaryFrame(Framedata framedata)
+
++ |
+
+ java.util.List<Framedata> |
+createFrames(byte[] binary,
+ boolean mask)
+
++ |
+
+ java.util.List<Framedata> |
+createFrames(java.lang.String text,
+ boolean mask)
+
++ |
+
+ Draft.CloseHandshakeType |
+getCloseHandshakeType()
+
++ |
+
+ ClientHandshakeBuilder |
+postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
+
++ |
+
+ HandshakeBuilder |
+postProcessHandshakeResponseAsServer(ClientHandshake request,
+ ServerHandshakeBuilder response)
+
++ |
+
+ void |
+reset()
+
++ |
+
+ java.util.List<Framedata> |
+translateFrame(java.nio.ByteBuffer buffer)
+
++ |
+
+protected java.util.List<Framedata> |
+translateRegularFrame(java.nio.ByteBuffer buffer)
+
++ |
+
| Methods inherited from class org.java_websocket.drafts.Draft | +
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshake, translateHandshakeHttp |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Field Detail | +
|---|
+public static final byte CR+
+
+public static final byte LF+
+
+public static final byte START_OF_FRAME+
+
+public static final byte END_OF_FRAME+
+
+protected boolean readingState+
+protected java.util.List<Framedata> readyframes+
+protected java.nio.ByteBuffer currentFrame+
| +Constructor Detail | +
|---|
+public Draft_75()+
| +Method Detail | +
|---|
+public Draft.HandshakeState acceptHandshakeAsClient(ClientHandshake request, + ServerHandshake response)+
acceptHandshakeAsClient in class Draft+public Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata)+
acceptHandshakeAsServer in class Draft+public java.nio.ByteBuffer createBinaryFrame(Framedata framedata)+
createBinaryFrame in class Draft+public java.util.List<Framedata> createFrames(byte[] binary, + boolean mask)+
createFrames in class Draft+public java.util.List<Framedata> createFrames(java.lang.String text, + boolean mask)+
createFrames in class Draft+public ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request) + throws InvalidHandshakeException+
postProcessHandshakeRequestAsClient in class DraftInvalidHandshakeException+public HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, + ServerHandshakeBuilder response) + throws InvalidHandshakeException+
postProcessHandshakeResponseAsServer in class DraftInvalidHandshakeException+protected java.util.List<Framedata> translateRegularFrame(java.nio.ByteBuffer buffer) + throws InvalidDataException+
InvalidDataException+public java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) + throws InvalidDataException+
translateFrame in class DraftInvalidDataException+public void reset()+ +
+public Draft.CloseHandshakeType getCloseHandshakeType()+
getCloseHandshakeType in class Draft
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.drafts.Draft +
org.java_websocket.drafts.Draft_75 +
org.java_websocket.drafts.Draft_76 +
public class Draft_76
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from class org.java_websocket.drafts.Draft | +
|---|
Draft.CloseHandshakeType, Draft.HandshakeState |
+
| +Field Summary | +
|---|
| Fields inherited from class org.java_websocket.drafts.Draft_75 | +
|---|
CR, currentFrame, END_OF_FRAME, LF, readingState, readyframes, START_OF_FRAME |
+
| Fields inherited from class org.java_websocket.drafts.Draft | +
|---|
FLASH_POLICY_REQUEST, role |
+
| +Constructor Summary | +|
|---|---|
Draft_76()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ Draft.HandshakeState |
+acceptHandshakeAsClient(ClientHandshake request,
+ ServerHandshake response)
+
++ |
+
+ Draft.HandshakeState |
+acceptHandshakeAsServer(ClientHandshake handshakedata)
+
++ |
+
+ java.nio.ByteBuffer |
+createBinaryFrame(Framedata framedata)
+
++ |
+
+static byte[] |
+createChallenge(java.lang.String key1,
+ java.lang.String key2,
+ byte[] key3)
+
++ |
+
+ Draft.CloseHandshakeType |
+getCloseHandshakeType()
+
++ |
+
+ ClientHandshakeBuilder |
+postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)
+
++ |
+
+ HandshakeBuilder |
+postProcessHandshakeResponseAsServer(ClientHandshake request,
+ ServerHandshakeBuilder response)
+
++ |
+
+ java.util.List<Framedata> |
+translateFrame(java.nio.ByteBuffer buffer)
+
++ |
+
+ Handshakedata |
+translateHandshake(java.nio.ByteBuffer buf)
+
++ |
+
| Methods inherited from class org.java_websocket.drafts.Draft_75 | +
|---|
createFrames, createFrames, reset, translateRegularFrame |
+
| Methods inherited from class org.java_websocket.drafts.Draft | +
|---|
basicAccept, checkAlloc, createHandshake, createHandshake, readLine, readStringLine, setParseMode, translateHandshakeHttp |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public Draft_76()+
| +Method Detail | +
|---|
+public static byte[] createChallenge(java.lang.String key1, + java.lang.String key2, + byte[] key3) + throws InvalidHandshakeException+
InvalidHandshakeException+public Draft.HandshakeState acceptHandshakeAsClient(ClientHandshake request, + ServerHandshake response)+
acceptHandshakeAsClient in class Draft_75+public Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake handshakedata)+
acceptHandshakeAsServer in class Draft_75+public ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder request)+
postProcessHandshakeRequestAsClient in class Draft_75+public HandshakeBuilder postProcessHandshakeResponseAsServer(ClientHandshake request, + ServerHandshakeBuilder response) + throws InvalidHandshakeException+
postProcessHandshakeResponseAsServer in class Draft_75InvalidHandshakeException+public Handshakedata translateHandshake(java.nio.ByteBuffer buf) + throws InvalidHandshakeException+
translateHandshake in class DraftInvalidHandshakeException+public java.util.List<Framedata> translateFrame(java.nio.ByteBuffer buffer) + throws InvalidDataException+
translateFrame in class Draft_75InvalidDataException+public java.nio.ByteBuffer createBinaryFrame(Framedata framedata)+
createBinaryFrame in class Draft_75+public Draft.CloseHandshakeType getCloseHandshakeType()+
getCloseHandshakeType in class Draft_75
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
|
+Classes
+
+ +Draft + +Draft_10 + +Draft_17 + +Draft_75 + +Draft_76 |
+
|
+Enums
+
+ +Draft.CloseHandshakeType + +Draft.HandshakeState |
+
+
+
|
++ + | +||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| +Class Summary | +|
|---|---|
| Draft | +Base class for everything of a websocket specification which is not common such as the way the handshake is read or frames are transfered. | +
| Draft_10 | ++ |
| Draft_17 | ++ |
| Draft_75 | ++ |
| Draft_76 | ++ |
+ +
| +Enum Summary | +|
|---|---|
| Draft.CloseHandshakeType | ++ |
| Draft.HandshakeState | ++ |
+
+
+
|
++ + | +||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +||||||||
java.lang.Object -java.lang.Throwable -
java.lang.Exception -
java.lang.RuntimeException -
net.tootallnate.websocket.exeptions.IncompleteHandshakeException +
java.lang.Throwable +
java.lang.Exception +
java.lang.RuntimeException +
org.java_websocket.exeptions.IncompleteHandshakeException
@@ -121,26 +121,26 @@
IncompleteHandshakeException()
+IncompleteHandshakeException()
IncompleteHandshakeException(java.lang.String message)
+IncompleteHandshakeException(java.lang.String message)
IncompleteHandshakeException(java.lang.String message,
+IncompleteHandshakeException(java.lang.String message,
java.lang.Throwable cause)
IncompleteHandshakeException(java.lang.Throwable cause)
+IncompleteHandshakeException(java.lang.Throwable cause)
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++java.lang.Throwable +
java.lang.Exception +
org.java_websocket.exeptions.InvalidDataException +
public class InvalidDataException
+
| +Constructor Summary | +|
|---|---|
InvalidDataException(int closecode)
+
++ |
+|
InvalidDataException(int closecode,
+ java.lang.String s)
+
++ |
+|
InvalidDataException(int closecode,
+ java.lang.String s,
+ java.lang.Throwable t)
+
++ |
+|
InvalidDataException(int closecode,
+ java.lang.Throwable t)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ int |
+getCloseCode()
+
++ |
+
| Methods inherited from class java.lang.Throwable | +
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public InvalidDataException(int closecode)+
+public InvalidDataException(int closecode, + java.lang.String s)+
+public InvalidDataException(int closecode, + java.lang.Throwable t)+
+public InvalidDataException(int closecode, + java.lang.String s, + java.lang.Throwable t)+
| +Method Detail | +
|---|
+public int getCloseCode()+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
java.lang.Object -java.lang.Throwable -
java.lang.Exception -
net.tootallnate.websocket.exeptions.InvalidDataException -
net.tootallnate.websocket.exeptions.InvalidFrameException +
java.lang.Throwable +
java.lang.Exception +
org.java_websocket.exeptions.InvalidDataException +
org.java_websocket.exeptions.InvalidFrameException
public class InvalidFrameException
public class InvalidFrameException
@@ -121,26 +121,26 @@
InvalidFrameException()
+InvalidFrameException()
InvalidFrameException(java.lang.String arg0)
+InvalidFrameException(java.lang.String arg0)
InvalidFrameException(java.lang.String arg0,
+InvalidFrameException(java.lang.String arg0,
java.lang.Throwable arg1)
InvalidFrameException(java.lang.Throwable arg0)
+InvalidFrameException(java.lang.Throwable arg0)
| Methods inherited from class org.java_websocket.exeptions.InvalidDataException | +
|---|
getCloseCode |
+
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
java.lang.Object -java.lang.Throwable -
java.lang.Exception -
net.tootallnate.websocket.exeptions.InvalidDataException -
net.tootallnate.websocket.exeptions.InvalidHandshakeException +
java.lang.Throwable +
java.lang.Exception +
org.java_websocket.exeptions.InvalidDataException +
org.java_websocket.exeptions.InvalidHandshakeException
public class InvalidHandshakeException
public class InvalidHandshakeException
@@ -121,26 +121,26 @@
InvalidHandshakeException()
+InvalidHandshakeException()
InvalidHandshakeException(java.lang.String arg0)
+InvalidHandshakeException(java.lang.String arg0)
InvalidHandshakeException(java.lang.String arg0,
+InvalidHandshakeException(java.lang.String arg0,
java.lang.Throwable arg1)
InvalidHandshakeException(java.lang.Throwable arg0)
+InvalidHandshakeException(java.lang.Throwable arg0)
| Methods inherited from class org.java_websocket.exeptions.InvalidDataException | +
|---|
getCloseCode |
+
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
java.lang.Object -java.lang.Throwable -
java.lang.Exception -
net.tootallnate.websocket.exeptions.InvalidDataException -
net.tootallnate.websocket.exeptions.LimitExedeedException +
java.lang.Throwable +
java.lang.Exception +
org.java_websocket.exeptions.InvalidDataException +
org.java_websocket.exeptions.LimitExedeedException
public class LimitExedeedException
public class LimitExedeedException
@@ -121,26 +121,13 @@
LimitExedeedException()
+LimitExedeedException()
LimitExedeedException(java.lang.String s)
-
-LimitExedeedException(java.lang.String s,
- java.lang.Throwable t)
-
-LimitExedeedException(java.lang.Throwable t)
+LimitExedeedException(java.lang.String s)
| Methods inherited from class org.java_websocket.exeptions.InvalidDataException | +
|---|
getCloseCode |
+
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
java.lang.Object -java.lang.Throwable -
java.lang.Exception -
net.tootallnate.websocket.exeptions.InvalidDataException +
java.lang.Throwable +
java.lang.Exception +
java.lang.RuntimeException +
org.java_websocket.exeptions.NotSendableException
public class InvalidDataException
public class NotSendableException
@@ -123,26 +121,26 @@
InvalidDataException()
+NotSendableException()
InvalidDataException(java.lang.String arg0)
+NotSendableException(java.lang.String message)
InvalidDataException(java.lang.String arg0,
- java.lang.Throwable arg1)
+NotSendableException(java.lang.String message,
+ java.lang.Throwable cause)
InvalidDataException(java.lang.Throwable arg0)
+NotSendableException(java.lang.Throwable cause)
-public InvalidDataException()+public NotSendableException()
-public InvalidDataException(java.lang.String arg0)+public NotSendableException(java.lang.String message)
-public InvalidDataException(java.lang.Throwable arg0)+public NotSendableException(java.lang.Throwable cause)
-public InvalidDataException(java.lang.String arg0, - java.lang.Throwable arg1)+public NotSendableException(java.lang.String message, + java.lang.Throwable cause)
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
|
+Exceptions
+
+ +IncompleteHandshakeException + +InvalidDataException + +InvalidFrameException + +InvalidHandshakeException + +LimitExedeedException + +NotSendableException |
+
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| IncompleteHandshakeException | +IncompleteHandshakeException | |
| InvalidDataException | +InvalidDataException | |
| InvalidFrameException | +InvalidFrameException | |
| InvalidHandshakeException | +InvalidHandshakeException | |
| LimitExedeedException | +LimitExedeedException | ++ |
| NotSendableException |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
public interface CloseFrame
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.java_websocket.framing.Framedata | +
|---|
Framedata.Opcode |
+
| +Field Summary | +|
|---|---|
+static int |
+ABNROMAL_CLOSE
+
++ 1006 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. |
+
+static int |
+BUGGYCLOSE
+
++ |
+
+static int |
+EXTENSION
+
++ 1010 indicates that an endpoint (client) is terminating the + connection because it has expected the server to negotiate one or + more extension, but the server didn't return them in the response + message of the WebSocket handshake. |
+
+static int |
+FLASHPOLICY
+
++ |
+
+static int |
+GOING_AWAY
+
++ 1001 indicates that an endpoint is "going away", such as a server + going down, or a browser having navigated away from a page. |
+
+static int |
+NEVERCONNECTED
+
++ The connection had never been established |
+
+static int |
+NO_UTF8
+
++ 1007 indicates that an endpoint is terminating the connection + because it has received data within a message that was not + consistent with the type of the message (e.g., non-UTF-8 [RFC3629] + data within a text message). |
+
+static int |
+NOCODE
+
++ 1005 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. |
+
+static int |
+NORMAL
+
++ indicates a normal closure, meaning whatever purpose the + connection was established for has been fulfilled. |
+
+static int |
+POLICY_VALIDATION
+
++ 1008 indicates that an endpoint is terminating the connection + because it has received a message that violates its policy. |
+
+static int |
+PROTOCOL_ERROR
+
++ 1002 indicates that an endpoint is terminating the connection due + to a protocol error. |
+
+static int |
+REFUSE
+
++ 1003 indicates that an endpoint is terminating the connection + because it has received a type of data it cannot accept (e.g. |
+
+static int |
+TOOBIG
+
++ 1009 indicates that an endpoint is terminating the connection + because it has received a message which is too big for it to + process. |
+
| +Method Summary | +|
|---|---|
+ int |
+getCloseCode()
+
++ |
+
+ java.lang.String |
+getMessage()
+
++ |
+
| Methods inherited from interface org.java_websocket.framing.Framedata | +
|---|
append, getOpcode, getPayloadData, getTransfereMasked, isFin |
+
| +Field Detail | +
|---|
+static final int NORMAL+
+
+static final int GOING_AWAY+
+
+static final int PROTOCOL_ERROR+
+
+static final int REFUSE+
+
+static final int NOCODE+
+
+static final int ABNROMAL_CLOSE+
+
+static final int NO_UTF8+
+
+static final int POLICY_VALIDATION+
+
+static final int TOOBIG+
+
+static final int EXTENSION+
+
+static final int NEVERCONNECTED+
+
+static final int BUGGYCLOSE+
+static final int FLASHPOLICY+
| +Method Detail | +
|---|
+int getCloseCode() + throws InvalidFrameException+
InvalidFrameException+java.lang.String getMessage() + throws InvalidDataException+
InvalidDataException
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.framing.FramedataImpl1 +
org.java_websocket.framing.CloseFrameBuilder +
public class CloseFrameBuilder
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.java_websocket.framing.Framedata | +
|---|
Framedata.Opcode |
+
| +Field Summary | +
|---|
| Fields inherited from class org.java_websocket.framing.FramedataImpl1 | +
|---|
emptyarray, fin, optcode, transferemasked |
+
| Fields inherited from interface org.java_websocket.framing.CloseFrame | +
|---|
ABNROMAL_CLOSE, BUGGYCLOSE, EXTENSION, FLASHPOLICY, GOING_AWAY, NEVERCONNECTED, NO_UTF8, NOCODE, NORMAL, POLICY_VALIDATION, PROTOCOL_ERROR, REFUSE, TOOBIG |
+
| +Constructor Summary | +|
|---|---|
CloseFrameBuilder()
+
++ |
+|
CloseFrameBuilder(int code)
+
++ |
+|
CloseFrameBuilder(int code,
+ java.lang.String m)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ int |
+getCloseCode()
+
++ |
+
+ java.lang.String |
+getMessage()
+
++ |
+
+ byte[] |
+getPayloadData()
+
++ |
+
+ void |
+setPayload(byte[] payload)
+
++ |
+
+ java.lang.String |
+toString()
+
++ |
+
| Methods inherited from class org.java_websocket.framing.FramedataImpl1 | +
|---|
append, getOpcode, getTransfereMasked, isFin, setFin, setOptcode, setTransferemasked |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| Methods inherited from interface org.java_websocket.framing.Framedata | +
|---|
append, getOpcode, getTransfereMasked, isFin |
+
| +Constructor Detail | +
|---|
+public CloseFrameBuilder()+
+public CloseFrameBuilder(int code) + throws InvalidDataException+
InvalidDataException+public CloseFrameBuilder(int code, + java.lang.String m) + throws InvalidDataException+
InvalidDataException| +Method Detail | +
|---|
+public int getCloseCode()+
getCloseCode in interface CloseFrame+public java.lang.String getMessage()+
getMessage in interface CloseFrame+public java.lang.String toString()+
toString in class FramedataImpl1+public void setPayload(byte[] payload) + throws InvalidDataException+
setPayload in interface FrameBuildersetPayload in class FramedataImpl1InvalidDataException+public byte[] getPayloadData()+
getPayloadData in interface FramedatagetPayloadData in class FramedataImpl1
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.framing.FramedataImpl1 +
public class FramedataImpl1
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.java_websocket.framing.Framedata | +
|---|
Framedata.Opcode |
+
| +Field Summary | +|
|---|---|
+protected static byte[] |
+emptyarray
+
++ |
+
+protected boolean |
+fin
+
++ |
+
+protected Framedata.Opcode |
+optcode
+
++ |
+
+protected boolean |
+transferemasked
+
++ |
+
| +Constructor Summary | +|
|---|---|
FramedataImpl1()
+
++ |
+|
FramedataImpl1(Framedata.Opcode op)
+
++ |
+|
FramedataImpl1(Framedata f)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+append(Framedata nextframe)
+
++ |
+
+ Framedata.Opcode |
+getOpcode()
+
++ |
+
+ byte[] |
+getPayloadData()
+
++ |
+
+ boolean |
+getTransfereMasked()
+
++ |
+
+ boolean |
+isFin()
+
++ |
+
+ void |
+setFin(boolean fin)
+
++ |
+
+ void |
+setOptcode(Framedata.Opcode optcode)
+
++ |
+
+ void |
+setPayload(byte[] payload)
+
++ |
+
+ void |
+setTransferemasked(boolean transferemasked)
+
++ |
+
+ java.lang.String |
+toString()
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Field Detail | +
|---|
+protected static byte[] emptyarray+
+protected boolean fin+
+protected Framedata.Opcode optcode+
+protected boolean transferemasked+
| +Constructor Detail | +
|---|
+public FramedataImpl1()+
+public FramedataImpl1(Framedata.Opcode op)+
+public FramedataImpl1(Framedata f)+
| +Method Detail | +
|---|
+public boolean isFin()+ +
+public Framedata.Opcode getOpcode()+ +
+public boolean getTransfereMasked()+
getTransfereMasked in interface Framedata+public byte[] getPayloadData()+
getPayloadData in interface Framedata+public void setFin(boolean fin)+
setFin in interface FrameBuilder+public void setOptcode(Framedata.Opcode optcode)+
setOptcode in interface FrameBuilder+public void setPayload(byte[] payload) + throws InvalidDataException+
setPayload in interface FrameBuilderInvalidDataException+public void setTransferemasked(boolean transferemasked)+
setTransferemasked in interface FrameBuilder+public void append(Framedata nextframe) + throws InvalidFrameException+
InvalidFrameException+public java.lang.String toString()+
toString in class java.lang.Object
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
|
+Interfaces
+
+ +CloseFrame + +FrameBuilder + +Framedata |
+
|
+Classes
+
+ +CloseFrameBuilder + +FramedataImpl1 |
+
|
+Enums
+
+ +Framedata.Opcode |
+
+
+
|
++ + | +||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+
+
|
++ + | +||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
public interface ClientHandshake
+
| +Method Summary | +|
|---|---|
+ java.lang.String |
+getResourceDescriptor()
+
++ |
+
| Methods inherited from interface org.java_websocket.handshake.Handshakedata | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields |
+
| +Method Detail | +
|---|
+java.lang.String getResourceDescriptor()+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
public interface ClientHandshakeBuilder
+
| +Method Summary | +|
|---|---|
+ void |
+setResourceDescriptor(java.lang.String resourcedescriptor)
+
++ |
+
| Methods inherited from interface org.java_websocket.handshake.HandshakeBuilder | +
|---|
put, setContent |
+
| Methods inherited from interface org.java_websocket.handshake.ClientHandshake | +
|---|
getResourceDescriptor |
+
| Methods inherited from interface org.java_websocket.handshake.Handshakedata | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields |
+
| +Method Detail | +
|---|
+void setResourceDescriptor(java.lang.String resourcedescriptor)+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.handshake.HandshakedataImpl1 +
org.java_websocket.handshake.HandshakeImpl1Client +
public class HandshakeImpl1Client
+
| +Constructor Summary | +|
|---|---|
HandshakeImpl1Client()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ java.lang.String |
+getResourceDescriptor()
+
++ |
+
+ void |
+setResourceDescriptor(java.lang.String resourcedescriptor)
+
++ |
+
| Methods inherited from class org.java_websocket.handshake.HandshakedataImpl1 | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields, put, setContent |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| Methods inherited from interface org.java_websocket.handshake.HandshakeBuilder | +
|---|
put, setContent |
+
| Methods inherited from interface org.java_websocket.handshake.Handshakedata | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields |
+
| +Constructor Detail | +
|---|
+public HandshakeImpl1Client()+
| +Method Detail | +
|---|
+public void setResourceDescriptor(java.lang.String resourcedescriptor) + throws java.lang.IllegalArgumentException+
setResourceDescriptor in interface ClientHandshakeBuilderjava.lang.IllegalArgumentException+public java.lang.String getResourceDescriptor()+
getResourceDescriptor in interface ClientHandshake
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+java.lang.Object ++org.java_websocket.handshake.HandshakedataImpl1 +
org.java_websocket.handshake.HandshakeImpl1Server +
public class HandshakeImpl1Server
+
| +Constructor Summary | +|
|---|---|
HandshakeImpl1Server()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ short |
+getHttpStatus()
+
++ |
+
+ java.lang.String |
+getHttpStatusMessage()
+
++ |
+
+ void |
+setHttpStatus(short status)
+
++ |
+
+ void |
+setHttpStatusMessage(java.lang.String message)
+
++ |
+
| Methods inherited from class org.java_websocket.handshake.HandshakedataImpl1 | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields, put, setContent |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| Methods inherited from interface org.java_websocket.handshake.HandshakeBuilder | +
|---|
put, setContent |
+
| Methods inherited from interface org.java_websocket.handshake.Handshakedata | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields |
+
| +Constructor Detail | +
|---|
+public HandshakeImpl1Server()+
| +Method Detail | +
|---|
+public java.lang.String getHttpStatusMessage()+
getHttpStatusMessage in interface ServerHandshake+public short getHttpStatus()+
getHttpStatus in interface ServerHandshake+public void setHttpStatusMessage(java.lang.String message)+
setHttpStatusMessage in interface ServerHandshakeBuilder+public void setHttpStatus(short status)+
setHttpStatus in interface ServerHandshakeBuilder
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
public interface ServerHandshake
+
| +Method Summary | +|
|---|---|
+ short |
+getHttpStatus()
+
++ |
+
+ java.lang.String |
+getHttpStatusMessage()
+
++ |
+
| Methods inherited from interface org.java_websocket.handshake.Handshakedata | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields |
+
| +Method Detail | +
|---|
+short getHttpStatus()+
+java.lang.String getHttpStatusMessage()+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
public interface ServerHandshakeBuilder
+
| +Method Summary | +|
|---|---|
+ void |
+setHttpStatus(short status)
+
++ |
+
+ void |
+setHttpStatusMessage(java.lang.String message)
+
++ |
+
| Methods inherited from interface org.java_websocket.handshake.HandshakeBuilder | +
|---|
put, setContent |
+
| Methods inherited from interface org.java_websocket.handshake.ServerHandshake | +
|---|
getHttpStatus, getHttpStatusMessage |
+
| Methods inherited from interface org.java_websocket.handshake.Handshakedata | +
|---|
getContent, getFieldValue, hasFieldValue, iterateHttpFields |
+
| +Method Detail | +
|---|
+void setHttpStatus(short status)+
+void setHttpStatusMessage(java.lang.String message)+
+
+
|
++ + | +||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +||||||||
|
+Interfaces
+
+ +ClientHandshake + +ClientHandshakeBuilder + +HandshakeBuilder + +Handshakedata + +ServerHandshake + +ServerHandshakeBuilder |
+
|
+Classes
+
+ +HandshakedataImpl1 + +HandshakeImpl1Client + +HandshakeImpl1Server |
+
+
+
|
++ + | +||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| +Interface Summary | +|
|---|---|
| ClientHandshake | ++ |
| ClientHandshakeBuilder | ++ |
| HandshakeBuilder | ++ |
| Handshakedata | ++ |
| ServerHandshake | ++ |
| ServerHandshakeBuilder | ++ |
+ +
| +Class Summary | +|
|---|---|
| HandshakedataImpl1 | ++ |
| HandshakeImpl1Client | ++ |
| HandshakeImpl1Server | ++ |
+
+
+
|
++ + | +||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+
+
|
++ + | +||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+
+
|
++ + | +||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +||||||||
|
+Interfaces
+
+ +WebSocketListener |
+
|
+Classes
+
+ +WebSocket + +WebSocketAdapter + +WebSocketClient + +WebSocketServer |
+
|
+Enums
+
+ +WebSocket.Role + +WebSocketListener.MessageType |
+
+
+
|
++ + | +||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| +Interface Summary | +|
|---|---|
| WebSocketListener | +Implemented by WebSocketClient and WebSocketServer. | +
+ +
| +Class Summary | +|
|---|---|
| WebSocket | +Represents one end (client or server) of a single WebSocket connection. | +
| WebSocketAdapter | ++ |
| WebSocketClient | +The WebSocketClient is an abstract class that expects a valid + "ws://" URI to connect to. | +
| WebSocketServer | +WebSocketServer is an abstract class that only takes care of the + HTTP handshake portion of WebSockets. | +
+ +
| +Enum Summary | +|
|---|---|
| WebSocket.Role | ++ |
| WebSocketListener.MessageType | ++ |
+
+
+
|
++ + | +||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+
+
|
++ + | +||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +||||||||
+
+
|
++ + | +||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +||||||||
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| Draft_10 | -+ | Base64 | +Encodes and decodes to and from Base64 notation. |
| Draft_17 | -+ | Base64.InputStream | +A Base64.InputStream will read data from another
+ java.io.InputStream, given in the constructor,
+ and encode/decode to/from Base64 notation on the fly. |
| Draft_75 | -+ | Base64.OutputStream | +A Base64.OutputStream will write data to another
+ java.io.OutputStream, given in the constructor,
+ and encode/decode to/from Base64 notation on the fly. |
| Draft_76 | +Charsetfunctions |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| Overview | +Overview | Package | Class | Tree | -Deprecated | -Index | -Help | +Deprecated | +Index | +Help |
| -Package net.tootallnate.websocket.exeptions | +Package org.java_websocket.exeptions
|---|
| -Class net.tootallnate.websocket.exeptions.IncompleteHandshakeException extends java.lang.RuntimeException implements Serializable | +Class org.java_websocket.exeptions.IncompleteHandshakeException extends java.lang.RuntimeException implements Serializable
|---|
| -Class net.tootallnate.websocket.exeptions.InvalidDataException extends java.lang.Exception implements Serializable | +Class org.java_websocket.exeptions.InvalidDataException extends java.lang.Exception implements Serializable +
|---|
| +Serialized Fields | +
|---|
+int closecode+
| +Class org.java_websocket.exeptions.InvalidFrameException extends InvalidDataException implements Serializable |
|---|
| -Class net.tootallnate.websocket.exeptions.InvalidFrameException extends InvalidDataException implements Serializable | +Class org.java_websocket.exeptions.InvalidHandshakeException extends InvalidDataException implements Serializable
|---|
| -Class net.tootallnate.websocket.exeptions.InvalidHandshakeException extends InvalidDataException implements Serializable | +Class org.java_websocket.exeptions.LimitExedeedException extends InvalidDataException implements Serializable
|---|
| -Class net.tootallnate.websocket.exeptions.LimitExedeedException extends InvalidDataException implements Serializable | +Class org.java_websocket.exeptions.NotSendableException extends java.lang.RuntimeException implements Serializable
|---|