public abstract class WebSocket extends Object implements AutoCloseable
| Constructor and Description |
|---|
WebSocket(URI uri,
HandshakeListener handshakeListener,
String... protocols) |
WebSocket(URI uri,
HandshakeListener handshakeListener,
WebSocketExtension[] extensions,
String... protocols) |
WebSocket(URI uri,
String... protocols) |
WebSocket(URI uri,
WebSocketExtension[] extensions,
String... protocols) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(CloseListener closeListener) |
void |
binary(byte[] buffer) |
void |
close() |
void |
close(CloseCode closeCode) |
void |
close(CloseCode closeCode,
String reason) |
int |
connectionState() |
String |
extensions() |
ConnectionState |
getConnectionState() |
int |
getMaxBinaryBufferSize() |
long |
getMaxIdleTimeoutMilliseconds() |
int |
getMaxTextBufferSize() |
String |
getNegotiatedProtocol() |
int |
getProtocolVersion() |
URI |
getUri() |
boolean |
isSecure() |
abstract void |
onBinary(byte[] message) |
abstract void |
onError(Exception exception) |
abstract void |
onPong(byte[] message) |
abstract void |
onText(String message) |
void |
ping(byte[] buffer) |
void |
setMaxBinaryBufferSize(int size) |
void |
setMaxIdleTimeoutMilliseconds(long milliseconds) |
void |
setMaxTextBufferSize(int size) |
void |
text(String message) |
String |
url() |
public WebSocket(URI uri, String... protocols) throws IOException, NoSuchAlgorithmException, WebSocketException
public WebSocket(URI uri, WebSocketExtension[] extensions, String... protocols) throws IOException, NoSuchAlgorithmException, WebSocketException
public WebSocket(URI uri, HandshakeListener handshakeListener, String... protocols) throws IOException, NoSuchAlgorithmException, WebSocketException
public WebSocket(URI uri, HandshakeListener handshakeListener, WebSocketExtension[] extensions, String... protocols) throws IOException, NoSuchAlgorithmException, WebSocketException
public abstract void onError(Exception exception)
public abstract void onPong(byte[] message)
public abstract void onText(String message)
public abstract void onBinary(byte[] message)
public void ping(byte[] buffer)
throws IOException,
WebSocketException
IOExceptionWebSocketExceptionpublic void text(String message) throws IOException, WebSocketException
IOExceptionWebSocketExceptionpublic void binary(byte[] buffer)
throws IOException,
WebSocketException
IOExceptionWebSocketExceptionpublic void addCloseListener(CloseListener closeListener)
public void close()
throws IOException,
WebSocketException,
InterruptedException
close in interface AutoCloseableIOExceptionWebSocketExceptionInterruptedExceptionpublic void close(CloseCode closeCode) throws IOException, WebSocketException, InterruptedException
public void close(CloseCode closeCode, String reason) throws IOException, WebSocketException, InterruptedException
public int getProtocolVersion()
public String getNegotiatedProtocol()
public boolean isSecure()
public URI getUri()
public String url()
public ConnectionState getConnectionState()
public int connectionState()
public String extensions()
public int getMaxBinaryBufferSize()
public void setMaxBinaryBufferSize(int size)
public int getMaxTextBufferSize()
public void setMaxTextBufferSize(int size)
public long getMaxIdleTimeoutMilliseconds()
public void setMaxIdleTimeoutMilliseconds(long milliseconds)
Copyright © 2016. All rights reserved.