public class WebSocketClientProtocolHandler extends io.netty.channel.ChannelInboundMessageHandlerAdapter<WebSocketFrame>
handleCloseFrames is false, default is true.
This implementation will establish the websocket connection once the connection to the remote server was complete.| Constructor and Description |
|---|
WebSocketClientProtocolHandler(URI webSocketURL,
WebSocketVersion version,
String subprotocol,
boolean allowExtensions,
HttpHeaders customHeaders,
int maxFramePayloadLength)
Base constructor
|
WebSocketClientProtocolHandler(URI webSocketURL,
WebSocketVersion version,
String subprotocol,
boolean allowExtensions,
HttpHeaders customHeaders,
int maxFramePayloadLength,
boolean handleCloseFrames)
Base constructor
|
WebSocketClientProtocolHandler(WebSocketClientHandshaker handshaker)
Base constructor
|
WebSocketClientProtocolHandler(WebSocketClientHandshaker handshaker,
boolean handleCloseFrames)
Base constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterAdd(io.netty.channel.ChannelHandlerContext ctx) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
void |
messageReceived(io.netty.channel.ChannelHandlerContext ctx,
WebSocketFrame frame) |
acceptInboundMessage, beginMessageReceived, endMessageReceived, freeInboundBuffer, inboundBufferUpdated, newInboundBufferchannelActive, channelInactive, channelReadSuspended, channelRegistered, channelUnregistered, userEventTriggeredafterRemove, beforeAdd, beforeRemoveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic WebSocketClientProtocolHandler(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean handleCloseFrames)
webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL.version - Version of web socket specification to use to connect to the serversubprotocol - Sub protocol request sent to the server.customHeaders - Map of custom headers to add to the client requestmaxFramePayloadLength - Maximum length of a frame's payloadhandleCloseFrames - true if close frames should not be forwarded and just close the channelpublic WebSocketClientProtocolHandler(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength)
webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL.version - Version of web socket specification to use to connect to the serversubprotocol - Sub protocol request sent to the server.customHeaders - Map of custom headers to add to the client requestmaxFramePayloadLength - Maximum length of a frame's payloadpublic WebSocketClientProtocolHandler(WebSocketClientHandshaker handshaker, boolean handleCloseFrames)
handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection
was established to the remote peer.handleCloseFrames - true if close frames should not be forwarded and just close the channelpublic WebSocketClientProtocolHandler(WebSocketClientHandshaker handshaker)
handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection
was established to the remote peer.public void messageReceived(io.netty.channel.ChannelHandlerContext ctx,
WebSocketFrame frame)
throws Exception
messageReceived in interface io.netty.channel.ChannelHandlerUtil.SingleInboundMessageHandler<WebSocketFrame>Exceptionpublic void afterAdd(io.netty.channel.ChannelHandlerContext ctx)
afterAdd in interface io.netty.channel.ChannelHandlerafterAdd in class io.netty.channel.ChannelHandlerAdapterCopyright © 2008-2013 The Netty Project. All Rights Reserved.