class WebSocketServerProtocolHandshakeHandler extends ChannelInboundHandlerAdapter
WebSocketServerProtocolHandler
.ChannelHandler.Sharable
Modifier and Type | Field and Description |
---|---|
private boolean |
allowExtensions |
private int |
maxFramePayloadSize |
private java.lang.String |
subprotocols |
private java.lang.String |
websocketPath |
Constructor and Description |
---|
WebSocketServerProtocolHandshakeHandler(java.lang.String websocketPath,
java.lang.String subprotocols,
boolean allowExtensions,
int maxFrameSize) |
Modifier and Type | Method and Description |
---|---|
void |
channelRead(ChannelHandlerContext ctx,
java.lang.Object msg)
Calls
ChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline . |
private static java.lang.String |
getWebSocketLocation(ChannelPipeline cp,
HttpRequest req,
java.lang.String path) |
private static void |
sendHttpResponse(ChannelHandlerContext ctx,
HttpRequest req,
HttpResponse res) |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
private final java.lang.String websocketPath
private final java.lang.String subprotocols
private final boolean allowExtensions
private final int maxFramePayloadSize
WebSocketServerProtocolHandshakeHandler(java.lang.String websocketPath, java.lang.String subprotocols, boolean allowExtensions, int maxFrameSize)
public void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireChannelRead(Object)
to forward
to the next ChannelInboundHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelRead
in interface ChannelInboundHandler
channelRead
in class ChannelInboundHandlerAdapter
java.lang.Exception
private static void sendHttpResponse(ChannelHandlerContext ctx, HttpRequest req, HttpResponse res)
private static java.lang.String getWebSocketLocation(ChannelPipeline cp, HttpRequest req, java.lang.String path)