public class WebSocketServerProtocolHandler extends MessageToMessageDecoder<WebSocketFrame>
ChannelHandler.userEventTriggered(ChannelHandlerContext, Object)
and check if the event was of type
WebSocketServerProtocolHandler.ServerHandshakeStateEvent.HANDSHAKE_COMPLETE
.Modifier and Type | Class and Description |
---|---|
static class |
WebSocketServerProtocolHandler.ServerHandshakeStateEvent
Events that are fired to notify about handshake status
|
ChannelHandler.Sharable, ChannelHandler.Skip
Constructor and Description |
---|
WebSocketServerProtocolHandler(String websocketPath) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols,
boolean allowExtensions) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols,
boolean allowExtensions,
int maxFrameSize) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols,
boolean allowExtensions,
int maxFrameSize,
boolean allowMaskMismatch) |
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx,
WebSocketFrame frame,
List<Object> out)
Decode from one message to an other.
|
void |
exceptionCaught(ChannelHandlerContext ctx,
Throwable cause)
Calls
ChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline . |
void |
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
acceptInboundMessage, channelRead
bind, channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerRemoved, isSharable, read, userEventTriggered, write
public WebSocketServerProtocolHandler(String websocketPath)
public WebSocketServerProtocolHandler(String websocketPath, String subprotocols)
public WebSocketServerProtocolHandler(String websocketPath, String subprotocols, boolean allowExtensions)
public WebSocketServerProtocolHandler(String websocketPath, String subprotocols, boolean allowExtensions, int maxFrameSize)
public void handlerAdded(ChannelHandlerContext ctx)
ChannelHandlerAdapter
handlerAdded
in interface ChannelHandler
handlerAdded
in class ChannelHandlerAdapter
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception
MessageToMessageDecoder
ctx
- the ChannelHandlerContext
which this MessageToMessageDecoder
belongs toframe
- the message to decode to an other oneout
- the List
to which decoded messages should be addedException
- is thrown if an error accourpublic void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
ChannelHandlerAdapter
ChannelHandlerContext.fireExceptionCaught(Throwable)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.exceptionCaught
in interface ChannelHandler
Exception
Copyright © 2008–2015 The Netty Project. All rights reserved.