|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WebSocket
Field Summary | |
---|---|
static int |
END_POINT_GOING_DOWN
Indicates that an endpoint is "going away", such as a server going down, or a browser having navigated away from a page. |
static int |
INVALID_DATA
Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g. |
static int |
MESSAGE_TOO_LARGE
indicates that an endpoint is terminating the connection because it has received a message that is too large. |
static int |
NORMAL_CLOSURE
Indicates a normal closure, meaning whatever purpose the connection was established for has been fulfilled. |
static int |
PROTOCOL_ERROR
Indicates that an endpoint is terminating the connection due to a protocol error. |
Method Summary | |
---|---|
boolean |
add(WebSocketListener listener)
|
void |
close()
|
void |
close(int code)
|
void |
close(int code,
String reason)
|
boolean |
isConnected()
|
void |
onClose(DataFrame frame)
|
void |
onConnect()
|
void |
onFragment(boolean last,
byte[] binaryPayload)
|
void |
onMessage(byte[] data)
|
void |
onMessage(String text)
|
void |
onPing(DataFrame frame)
|
void |
onPong(DataFrame frame)
|
boolean |
remove(WebSocketListener listener)
|
void |
send(byte[] data)
|
void |
send(String data)
Write the data to the socket. |
void |
stream(boolean last,
byte[] bytes,
int off,
int len)
|
Field Detail |
---|
static final int NORMAL_CLOSURE
static final int END_POINT_GOING_DOWN
static final int PROTOCOL_ERROR
static final int INVALID_DATA
static final int MESSAGE_TOO_LARGE
Method Detail |
---|
void send(String data)
data
-
IOException
void send(byte[] data)
void close()
void close(int code)
void close(int code, String reason)
boolean isConnected()
void onConnect()
void onMessage(String text)
void onMessage(byte[] data)
void onClose(DataFrame frame)
void onPing(DataFrame frame)
void onPong(DataFrame frame)
void onFragment(boolean last, byte[] binaryPayload)
boolean add(WebSocketListener listener)
boolean remove(WebSocketListener listener)
void stream(boolean last, byte[] bytes, int off, int len)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |