Added documentation to websocket classes.

This commit is contained in:
Veebs 2012-12-11 22:43:57 -08:00 committed by Norman Maurer
parent 2903b91e66
commit 2704efc056
2 changed files with 11 additions and 7 deletions

View File

@ -28,8 +28,16 @@ import io.netty.util.AttributeKey;
import static io.netty.handler.codec.http.HttpVersion.*;
/**
* Handles WebSocket control frames (Close, Ping, Pong) and data frames (Text and Binary) are passed
* to the next handler in the pipeline.
* This handler does all the heavy lifting for you to run a websocket server.
*
* It takes care of websocket handshaking as well as processing of control frames (Close, Ping, Pong). Text and Binary
* data frames are passed to the next handler in the pipeline (implemented by you) for processing.
*
* See <tt>io.netty.example.http.websocketx.html5.WebSocketServer</tt> for usage.
*
* The implementation of this handler assumes that you just want to run a websocket server and not process other types
* HTTP requests (like GET and POST). If you wish to support both HTTP requests and websockets in the one server, refer
* to the <tt>io.netty.example.http.websocketx.server.WebSocketServer</tt> example.
*/
public class WebSocketServerProtocolHandler extends ChannelInboundMessageHandlerAdapter<WebSocketFrame> {

View File

@ -29,16 +29,12 @@ import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.ssl.SslHandler;
import io.netty.logging.InternalLogger;
import io.netty.logging.InternalLoggerFactory;
/**
* Handles the HTTP handshake (the HTTP Upgrade request)
* Handles the HTTP handshake (the HTTP Upgrade request) for {@link WebSocketServerProtocolHandler}.
*/
public class WebSocketServerProtocolHandshakeHandler extends ChannelInboundMessageHandlerAdapter<HttpRequest> {
private static final InternalLogger logger =
InternalLoggerFactory.getInstance(WebSocketServerProtocolHandshakeHandler.class);
private final String websocketPath;
private final String subprotocols;
private final boolean allowExtensions;