public class GrizzlyClientSocket extends Object implements org.glassfish.tyrus.websockets.WebSocket, org.glassfish.tyrus.spi.TyrusClientSocket
| Modifier and Type | Field and Description |
|---|---|
static Logger |
LOGGER |
static String |
PROXY_URI
Can be used as client-side user property to set proxy.
|
static String |
SELECTOR_THREAD_POOL_CONFIG
Client-side property to set custom selector
ThreadPoolConfig. |
static String |
WORKER_THREAD_POOL_CONFIG
Client-side property to set custom worker
ThreadPoolConfig. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(org.glassfish.tyrus.websockets.WebSocketListener webSocketListener) |
void |
close() |
void |
close(int i) |
void |
close(int i,
String s) |
void |
connect()
Connects to the given
URI. |
javax.websocket.Session |
getSession() |
boolean |
isConnected() |
void |
onClose(org.glassfish.tyrus.websockets.draft06.ClosingFrame dataFrame) |
void |
onConnect() |
void |
onFragment(boolean bool,
byte[] bytes) |
void |
onFragment(boolean b,
String s) |
void |
onMessage(byte[] bytes) |
void |
onMessage(String message) |
void |
onPing(org.glassfish.tyrus.websockets.DataFrame dataFrame) |
void |
onPong(org.glassfish.tyrus.websockets.DataFrame dataFrame) |
boolean |
remove(org.glassfish.tyrus.websockets.WebSocketListener webSocketListener) |
Future<org.glassfish.tyrus.websockets.DataFrame> |
send(byte[] bytes) |
Future<org.glassfish.tyrus.websockets.DataFrame> |
send(String s) |
Future<org.glassfish.tyrus.websockets.DataFrame> |
sendPing(byte[] bytes) |
Future<org.glassfish.tyrus.websockets.DataFrame> |
sendPong(byte[] bytes) |
void |
setWriteTimeout(long timeoutMs) |
Future<org.glassfish.tyrus.websockets.DataFrame> |
stream(boolean b,
byte[] bytes,
int i,
int i1) |
Future<org.glassfish.tyrus.websockets.DataFrame> |
stream(boolean b,
String s) |
public static final String PROXY_URI
String and represent proxy URI. Protocol part is currently ignored
but must be present (URI.URI(String) is used for parsing).
client.getProperties().put(GrizzlyClientSocket.PROXY_URI, "http://my.proxy.com:80");
client.connectToServer(...);
EndpointConfig.getUserProperties(),
Constant Field Valuespublic static final String WORKER_THREAD_POOL_CONFIG
ThreadPoolConfig.
Value is expected to be instance of ThreadPoolConfig, can be null (it won't be used).public static final String SELECTOR_THREAD_POOL_CONFIG
ThreadPoolConfig.
Value is expected to be instance of ThreadPoolConfig, can be null (it won't be used).public static final Logger LOGGER
public void connect()
URI.public Future<org.glassfish.tyrus.websockets.DataFrame> send(String s)
send in interface org.glassfish.tyrus.websockets.WebSocketpublic Future<org.glassfish.tyrus.websockets.DataFrame> send(byte[] bytes)
send in interface org.glassfish.tyrus.websockets.WebSocketpublic Future<org.glassfish.tyrus.websockets.DataFrame> sendPing(byte[] bytes)
sendPing in interface org.glassfish.tyrus.websockets.WebSocketpublic Future<org.glassfish.tyrus.websockets.DataFrame> sendPong(byte[] bytes)
sendPong in interface org.glassfish.tyrus.websockets.WebSocketpublic Future<org.glassfish.tyrus.websockets.DataFrame> stream(boolean b, String s)
stream in interface org.glassfish.tyrus.websockets.WebSocketpublic Future<org.glassfish.tyrus.websockets.DataFrame> stream(boolean b, byte[] bytes, int i, int i1)
stream in interface org.glassfish.tyrus.websockets.WebSocketpublic void close()
close in interface org.glassfish.tyrus.spi.TyrusClientSocketclose in interface org.glassfish.tyrus.websockets.WebSocketpublic javax.websocket.Session getSession()
getSession in interface org.glassfish.tyrus.spi.TyrusClientSocketpublic void close(int i)
close in interface org.glassfish.tyrus.websockets.WebSocketpublic void close(int i,
String s)
close in interface org.glassfish.tyrus.websockets.WebSocketpublic boolean isConnected()
isConnected in interface org.glassfish.tyrus.websockets.WebSocketpublic void onConnect()
onConnect in interface org.glassfish.tyrus.websockets.WebSocketpublic void onMessage(String message)
onMessage in interface org.glassfish.tyrus.websockets.WebSocketpublic void onMessage(byte[] bytes)
onMessage in interface org.glassfish.tyrus.websockets.WebSocketpublic void onFragment(boolean b,
String s)
onFragment in interface org.glassfish.tyrus.websockets.WebSocketpublic void onFragment(boolean bool,
byte[] bytes)
onFragment in interface org.glassfish.tyrus.websockets.WebSocketpublic void onClose(org.glassfish.tyrus.websockets.draft06.ClosingFrame dataFrame)
onClose in interface org.glassfish.tyrus.websockets.WebSocketpublic void onPing(org.glassfish.tyrus.websockets.DataFrame dataFrame)
onPing in interface org.glassfish.tyrus.websockets.WebSocketpublic void onPong(org.glassfish.tyrus.websockets.DataFrame dataFrame)
onPong in interface org.glassfish.tyrus.websockets.WebSocketpublic boolean add(org.glassfish.tyrus.websockets.WebSocketListener webSocketListener)
add in interface org.glassfish.tyrus.websockets.WebSocketpublic boolean remove(org.glassfish.tyrus.websockets.WebSocketListener webSocketListener)
remove in interface org.glassfish.tyrus.websockets.WebSocketpublic void setWriteTimeout(long timeoutMs)
setWriteTimeout in interface org.glassfish.tyrus.websockets.WebSocketCopyright © 2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.