public interface WebSocket
| 限定符和类型 | 方法和说明 |
|---|---|
void |
awaitClose()
await close
|
void |
close()
Close.
|
void |
connect()
Connect.
|
Frame |
createFrame(byte[] bytes)
Creates the frame.
|
Frame |
createFrame(ByteBuffer buffer)
Creates the frame.
|
Frame |
createFrame(Object obj)
Creates the frame.
|
Frame |
createFrame(String str)
Creates the frame.
|
int |
getBufferSize()
Gets the buffer size.
|
int |
getConnectionTimeout()
Gets the connection timeout.
|
InetSocketAddress |
getEndpoint()
Gets the endpoint.
|
URI |
getLocation()
Gets the location.
|
boolean |
isBlockingMode()
Checks if is blocking mode.
|
boolean |
isConnected()
Checks if is connected.
|
void |
send(byte[] bytes)
Send.
|
void |
send(ByteBuffer buffer)
Send.
|
void |
send(Frame frame)
Send.
|
void |
send(String text)
Send.
|
void |
setBlockingMode(boolean blockingMode)
Sets the blocking mode.
|
void |
setConnectionTimeout(int connectionTimeout)
Sets the connection timeout.
|
void send(Frame frame) throws WebSocketException
frame - the frameWebSocketException - the web socket exceptionvoid send(ByteBuffer buffer) throws WebSocketException
buffer - the ByteBufferWebSocketException - the web socket exceptionvoid send(byte[] bytes) throws WebSocketException
bytes - the bytesWebSocketException - the web socket exceptionvoid send(String text) throws WebSocketException
text - the textWebSocketException - the web socket exceptionvoid connect()
throws WebSocketException,
IOException
WebSocketException - the web socket exceptionIOException - Signals that an I/O exception has occurred.boolean isConnected()
void close()
void awaitClose()
throws InterruptedException
boolean isBlockingMode()
void setBlockingMode(boolean blockingMode)
blockingMode - the new blocking modeURI getLocation()
InetSocketAddress getEndpoint()
int getBufferSize()
int getConnectionTimeout()
void setConnectionTimeout(int connectionTimeout)
connectionTimeout - the new connection timeoutFrame createFrame(Object obj) throws WebSocketException
obj - the objWebSocketException - the web socket exceptionFrame createFrame(byte[] bytes) throws WebSocketException
bytes - the byte arrayWebSocketException - the web socket exceptionFrame createFrame(ByteBuffer buffer) throws WebSocketException
buffer - the ByteBufferWebSocketException - the web socket exceptionFrame createFrame(String str) throws WebSocketException
str - the strWebSocketException - the web socket exceptionCopyright © 2020. All rights reserved.