Package er.woadaptor.websockets

Examples of er.woadaptor.websockets.WebSocketFactory


      }
    }
   
    protected void handleUpgradeRequest(ChannelHandlerContext ctx, HttpRequest req) {
      //If factory doesn't exist, close the upgrade request channel
      WebSocketFactory factory = WebSocketStore.defaultWebSocketStore().factory();
      if(factory == null) {
        ctx.getChannel().close();
        return;
      }
     
      WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                  ERWOAdaptorUtilities.getWebSocketLocation(req), null, false);
      handshaker = wsFactory.newHandshaker(req);
     
      Channel socketChannel = ctx.getChannel();
      if(handshaker == null) {
        wsFactory.sendUnsupportedWebSocketVersionResponse(socketChannel);
      } else {
        ChannelFuture future = handshaker.handshake(socketChannel, req);
        //TODO tie this to the channel future result?
        //Create a WebSocket instance to handle frames
        WebSocket socket = factory.create(socketChannel, req);
        WebSocketStore.defaultWebSocketStore().takeSocketForChannel(socket, socketChannel);
       
        socket.didUpgrade();
      }
    }
View Full Code Here

TOP

Related Classes of er.woadaptor.websockets.WebSocketFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.