public class WebSocketServerProtocolHandler extends MessageToMessageDecoder<WebSocketFrame>
ChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object)
and check if the event was instance
of WebSocketServerProtocolHandler.HandshakeComplete
, the event will contain extra information about the handshake such as the request and
selected subprotocol.Modifier and Type | Class and Description |
---|---|
static class |
WebSocketServerProtocolHandler.HandshakeComplete
The Handshake was completed successfully and the channel was upgraded to websockets.
|
static class |
WebSocketServerProtocolHandler.ServerHandshakeStateEvent
Events that are fired to notify about handshake status
|
ChannelHandler.Sharable
Constructor and Description |
---|
WebSocketServerProtocolHandler(String websocketPath) |
WebSocketServerProtocolHandler(String websocketPath,
boolean checkStartsWith) |
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) |
WebSocketServerProtocolHandler(String websocketPath,
String subprotocols,
boolean allowExtensions,
int maxFrameSize,
boolean allowMaskMismatch,
boolean checkStartsWith) |
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
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerRemoved
public WebSocketServerProtocolHandler(String websocketPath)
public WebSocketServerProtocolHandler(String websocketPath, boolean checkStartsWith)
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 WebSocketServerProtocolHandler(String websocketPath, String subprotocols, boolean allowExtensions, int maxFrameSize, boolean allowMaskMismatch)
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 occurspublic void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
ChannelInboundHandlerAdapter
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 interface ChannelInboundHandler
Exception
Copyright © 2008–2017 The Netty Project. All rights reserved.