Package org.jboss.netty.handler.codec.http.websocketx

Examples of org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame


        deployServlet(builder);

        WebSocketTestClient client = new WebSocketTestClient(getVersion(), new URI("ws://" + DefaultServer.getHostAddress("default") + ":" + DefaultServer.getHostPort("default") + "/"));
        client.connect();
        client.send(new TextWebSocketFrame(ChannelBuffers.wrappedBuffer(payload)), new FrameChecker(TextWebSocketFrame.class, payload, latch));
        latch.getIoFuture().get();
        latch2.getIoFuture().get();

        SendResult result = sendResult.get();
        Assert.assertNotNull(result);
View Full Code Here


        builder.addEndpoint(ServerEndpointConfig.Builder.create(TestEndPoint.class, "/").configurator(new InstanceConfigurator(new TestEndPoint())).build());
        deployServlet(builder);

        WebSocketTestClient client = new WebSocketTestClient(getVersion(), new URI("ws://" + DefaultServer.getHostAddress("default") + ":" + DefaultServer.getHostPort("default") + "/"));
        client.connect();
        client.send(new TextWebSocketFrame(ChannelBuffers.wrappedBuffer(payload)), new FrameChecker(TextWebSocketFrame.class, payload, latch));
        latch.getIoFuture().get();

        sendResult.get();

        client.destroy();
View Full Code Here

        builder.addEndpoint(ServerEndpointConfig.Builder.create(TestEndPoint.class, "/").configurator(new InstanceConfigurator(new TestEndPoint())).build());
        deployServlet(builder);

        WebSocketTestClient client = new WebSocketTestClient(getVersion(), new URI("ws://" + DefaultServer.getHostAddress("default") + ":" + DefaultServer.getHostPort("default") + "/"));
        client.connect();
        client.send(new TextWebSocketFrame(ChannelBuffers.wrappedBuffer(payload)), new FrameChecker(TextWebSocketFrame.class, payload, latch));
        latch.getIoFuture().get();
        Assert.assertNull(cause.get());
        client.destroy();
    }
View Full Code Here

        builder.addEndpoint(ServerEndpointConfig.Builder.create(TestEndPoint.class, "/").configurator(new InstanceConfigurator(new TestEndPoint())).build());
        deployServlet(builder);

        WebSocketTestClient client = new WebSocketTestClient(getVersion(), new URI("ws://" + DefaultServer.getHostAddress("default") + ":" + DefaultServer.getHostPort("default") + "/"));
        client.connect();
        client.send(new TextWebSocketFrame(ChannelBuffers.wrappedBuffer(payload)), new FrameChecker(TextWebSocketFrame.class, payload, latch));
        latch.getIoFuture().get();
        Assert.assertNull(cause.get());
        client.destroy();
    }
View Full Code Here

    Object value = cache.get(key);
   
    JSONObject responseObject = toJSON(key, value, cache.getName());
   
    // Write the JSON response out onto the channel...
    ctx.getChannel().write(new TextWebSocketFrame(responseObject.toString()));
  }
View Full Code Here

    String jsonString = jsonObject.toString();
    for(ChannelNotifyParams channel : channels) {
      if(channel.channel.isOpen() && channel.onEvents.contains(eventType)) {
        if(channel.key != null) {
          if(event.getKey().equals(channel.key) || channel.key.equals("*")) {
            channel.channel.write(new TextWebSocketFrame(jsonString));
          }
        } else {         
          channel.channel.write(new TextWebSocketFrame(jsonString));
        }
      }
    }
  }
View Full Code Here

   
  @Override
    protected Object processMessage ( ChannelBuffer buffer ) {
      // Encode the message to base64
      ChannelBuffer base64Msg = Base64.encode(buffer, false);
      return new TextWebSocketFrame(base64Msg);
    }
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame

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.