@WebSocket(maxTextMessageSize=65536) public class WebSocketConnection extends Object
Constructor and Description |
---|
WebSocketConnection(URI url) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
close(String reason) |
void |
connect() |
WebSocketEventHandler |
getEventHandler() |
boolean |
isConnected() |
void |
onClose(int statusCode,
String reason) |
void |
onConnect(org.eclipse.jetty.websocket.api.Session session) |
void |
onError(Throwable cause) |
void |
onMessage(String msg) |
void |
send(String data) |
void |
setEventHandler(WebSocketEventHandler eventHandler) |
void |
setMaxMessageSize(int size) |
public WebSocketConnection(URI url) throws WebSocketException
WebSocketException
public void setEventHandler(WebSocketEventHandler eventHandler)
public WebSocketEventHandler getEventHandler()
public boolean isConnected()
public void connect() throws WebSocketException
WebSocketException
public void send(String data) throws WebSocketException
WebSocketException
public void close() throws WebSocketException
WebSocketException
public void close(String reason) throws WebSocketException
WebSocketException
@OnWebSocketClose public void onClose(int statusCode, String reason)
@OnWebSocketConnect public void onConnect(org.eclipse.jetty.websocket.api.Session session)
@OnWebSocketMessage public void onMessage(String msg)
@OnWebSocketError public void onError(Throwable cause)
public void setMaxMessageSize(int size)
Copyright © 2022. All rights reserved.