public class WSClient extends org.java_websocket.client.WebSocketClient implements AutoCloseable
| Constructor and Description |
|---|
WSClient(URI serverUri,
Transport transport,
ConnectionParam connectionParam,
WSFunction function)
create websocket connection client
|
| Modifier and Type | Method and Description |
|---|---|
static WSClient |
getInstance(ConnectionParam params,
WSFunction function,
Transport transport) |
static WSClient |
getSlaveInstance(ConnectionParam params,
WSFunction function,
Transport transport) |
void |
onClose(int code,
String reason,
boolean remote) |
void |
onError(Exception e) |
void |
onMessage(ByteBuffer bytes) |
void |
onMessage(String message) |
void |
onOpen(org.java_websocket.handshake.ServerHandshake serverHandshake) |
boolean |
reconnectBlockingWithoutRetry() |
void |
setBinaryMessageHandler(Consumer<ByteBuffer> binaryMessageHandler) |
void |
setTextMessageHandler(Consumer<String> textMessageHandler) |
void |
shutdown() |
addHeader, clearHeaders, close, close, close, closeBlocking, closeConnection, connect, connectBlocking, connectBlocking, getAttachment, getConnection, getConnections, getDraft, getLocalSocketAddress, getLocalSocketAddress, getProtocol, getReadyState, getRemoteSocketAddress, getRemoteSocketAddress, getResourceDescriptor, getSocket, getSSLSession, getURI, hasBufferedData, hasSSLSupport, isClosed, isClosing, isFlushAndClose, isOpen, onCloseInitiated, onClosing, onSetSSLParameters, onWebsocketClose, onWebsocketCloseInitiated, onWebsocketClosing, onWebsocketError, onWebsocketMessage, onWebsocketMessage, onWebsocketOpen, onWriteDemand, reconnect, reconnectBlocking, removeHeader, run, send, send, send, sendFragmentedFrame, sendFrame, sendFrame, sendPing, setAttachment, setDnsResolver, setProxy, setSocket, setSocketFactorygetConnectionLostTimeout, isReuseAddr, isTcpNoDelay, setConnectionLostTimeout, setReuseAddr, setTcpNoDelay, startConnectionLostTimer, stopConnectionLostTimeronPreparePing, onWebsocketHandshakeReceivedAsClient, onWebsocketHandshakeReceivedAsServer, onWebsocketHandshakeSentAsClient, onWebsocketPing, onWebsocketPongclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic final String serverUri
public WSClient(URI serverUri, Transport transport, ConnectionParam connectionParam, WSFunction function)
serverUri - connection urlpublic void setBinaryMessageHandler(Consumer<ByteBuffer> binaryMessageHandler)
public void onOpen(org.java_websocket.handshake.ServerHandshake serverHandshake)
onOpen in class org.java_websocket.client.WebSocketClientpublic void onMessage(String message)
onMessage in class org.java_websocket.client.WebSocketClientpublic void onMessage(ByteBuffer bytes)
onMessage in class org.java_websocket.client.WebSocketClientpublic void onClose(int code,
String reason,
boolean remote)
onClose in class org.java_websocket.client.WebSocketClientpublic void onError(Exception e)
onError in class org.java_websocket.client.WebSocketClientpublic void shutdown()
public boolean reconnectBlockingWithoutRetry()
throws InterruptedException
InterruptedExceptionpublic static WSClient getInstance(ConnectionParam params, WSFunction function, Transport transport) throws SQLException
SQLExceptionpublic static WSClient getSlaveInstance(ConnectionParam params, WSFunction function, Transport transport) throws SQLException
SQLExceptionCopyright © 2025. All rights reserved.