public class WebSocketServerProtocolHandler extends ChannelInboundMessageHandlerAdapter<WebSocketFrame>
ChannelHandler.Sharable
ABORT
Constructor and Description |
---|
WebSocketServerProtocolHandler(String websocketPath) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols,
boolean allowExtensions) |
Modifier and Type | Method and Description |
---|---|
void |
afterAdd(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
void |
exceptionCaught(ChannelHandlerContext ctx,
Throwable cause)
Calls
ChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline . |
void |
messageReceived(ChannelHandlerContext ctx,
WebSocketFrame frame)
Is called once a message was received.
|
acceptInboundMessage, beginMessageReceived, endMessageReceived, freeInboundBuffer, inboundBufferUpdated, newInboundBuffer
channelActive, channelInactive, channelReadSuspended, channelRegistered, channelUnregistered, userEventTriggered
afterRemove, beforeAdd, beforeRemove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
channelActive, channelInactive, channelReadSuspended, channelRegistered, channelUnregistered, userEventTriggered
afterRemove, beforeAdd, beforeRemove
public WebSocketServerProtocolHandler(String websocketPath)
public WebSocketServerProtocolHandler(String websocketPath, String subprotocols)
public void afterAdd(ChannelHandlerContext ctx)
ChannelHandlerAdapter
afterAdd
in interface ChannelHandler
afterAdd
in class ChannelHandlerAdapter
public void messageReceived(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exception
ChannelHandlerUtil.SingleInboundMessageHandler
ctx
- the ChannelHandlerContext
which this ChannelHandler
belongs toframe
- the message to handleException
public 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
exceptionCaught
in class ChannelHandlerAdapter
Exception
Copyright © 2008-2013 The Netty Project. All Rights Reserved.