public class WebSocketTransport extends com.ning.http.client.ws.WebSocketUpgradeHandler implements Transport
Transport implementation| Modifier and Type | Field and Description |
|---|---|
protected boolean |
protocolEnabled |
protected boolean |
protocolReceived |
protected boolean |
supportBinary |
protected ScheduledExecutorService |
timer |
| Constructor and Description |
|---|
WebSocketTransport(com.ning.http.client.RequestBuilder requestBuilder,
Options options,
Request request,
List<FunctionWrapper> functions) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying transport}
|
void |
connectedFuture(Future f)
Set the
Future, which will unlock the Socket.fire(java.lang.Object) method once the connection has been fully established. |
void |
error(Throwable t)
Set a
Throwable |
boolean |
errorHandled()
Error handled by a
Function |
void |
future(Future f)
Set the
Future, which can be used to clone the connection. |
Request.TRANSPORT |
name()
The transport name
|
com.ning.http.client.AsyncHandler.STATE |
onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart) |
com.ning.http.client.ws.WebSocket |
onCompleted() |
void |
onFailure(Throwable t) |
com.ning.http.client.AsyncHandler.STATE |
onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers) |
com.ning.http.client.AsyncHandler.STATE |
onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus) |
void |
onSuccess(com.ning.http.client.ws.WebSocket webSocket) |
void |
onThrowable(Throwable t)
Called when an unexpected exception ocurred.
|
Transport |
registerF(FunctionWrapper function)
Register a new
FunctionResolver |
WebSocketTransport |
sendMessage(byte[] message) |
WebSocketTransport |
sendMessage(String message) |
Socket.STATUS |
status()
Return the current
Socket.STATUS |
protected final boolean protocolEnabled
protected boolean supportBinary
protected final ScheduledExecutorService timer
protected boolean protocolReceived
public WebSocketTransport(com.ning.http.client.RequestBuilder requestBuilder,
Options options,
Request request,
List<FunctionWrapper> functions)
public void onThrowable(Throwable t)
onThrowable in interface com.ning.http.client.AsyncHandler<com.ning.http.client.ws.WebSocket>onThrowable in interface TransportonThrowable in class com.ning.http.client.ws.WebSocketUpgradeHandlert - a Throwablepublic void close()
public Socket.STATUS status()
Socket.STATUSpublic boolean errorHandled()
FunctionerrorHandled in interface Transportpublic void connectedFuture(Future f)
TransportFuture, which will unlock the Socket.fire(java.lang.Object) method once the connection has been fully established.connectedFuture in interface Transportf - Futurepublic com.ning.http.client.AsyncHandler.STATE onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart)
throws Exception
onBodyPartReceived in interface com.ning.http.client.AsyncHandler<com.ning.http.client.ws.WebSocket>onBodyPartReceived in class com.ning.http.client.ws.WebSocketUpgradeHandlerExceptionpublic com.ning.http.client.AsyncHandler.STATE onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus)
throws Exception
onStatusReceived in interface com.ning.http.client.AsyncHandler<com.ning.http.client.ws.WebSocket>onStatusReceived in class com.ning.http.client.ws.WebSocketUpgradeHandlerExceptionpublic com.ning.http.client.AsyncHandler.STATE onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers)
throws Exception
onHeadersReceived in interface com.ning.http.client.AsyncHandler<com.ning.http.client.ws.WebSocket>onHeadersReceived in class com.ning.http.client.ws.WebSocketUpgradeHandlerExceptionpublic com.ning.http.client.ws.WebSocket onCompleted()
throws Exception
onCompleted in interface com.ning.http.client.AsyncHandler<com.ning.http.client.ws.WebSocket>onCompleted in class com.ning.http.client.ws.WebSocketUpgradeHandlerExceptionpublic void onSuccess(com.ning.http.client.ws.WebSocket webSocket)
onSuccess in interface com.ning.http.client.UpgradeHandler<com.ning.http.client.ws.WebSocket>onSuccess in class com.ning.http.client.ws.WebSocketUpgradeHandlerpublic Request.TRANSPORT name()
public Transport registerF(FunctionWrapper function)
FunctionResolverregisterF in interface Transportfunction - FunctionResolverpublic final void onFailure(Throwable t)
onFailure in interface com.ning.http.client.UpgradeHandler<com.ning.http.client.ws.WebSocket>onFailure in class com.ning.http.client.ws.WebSocketUpgradeHandlerpublic WebSocketTransport sendMessage(String message)
public WebSocketTransport sendMessage(byte[] message)
Copyright © 2015. All Rights Reserved.