Examples of connect()


Examples of io.netty.channel.embedded.EmbeddedChannel.connect()

    @Test
    public void shouldLogChannelConnect() throws Exception {
        appender.doAppend(matchesLog(".+CONNECT: 0.0.0.0/0.0.0.0:80$"));
        replay(appender);
        EmbeddedChannel channel = new EmbeddedChannel(new LoggingHandler());
        channel.connect(new InetSocketAddress(80)).await();
        verify(appender);
    }

    @Test
    public void shouldLogChannelConnectWithLocalAddress() throws Exception {
View Full Code Here

Examples of io.netty.channel.socket.SocketChannel.connect()

  public static void main(String[] args) throws Exception {
    final SocketChannel ch = new NioSocketChannel();
    new NioEventLoopGroup().register(ch);
    final long start = System.currentTimeMillis();
    ch.pipeline().addLast(new RedisCommandEncoder(), new RedisReplyDecoder());
    ch.connect(new InetSocketAddress("localhost", 6379)).addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture channelFuture) throws Exception {
        write(ch);
      }
    });
View Full Code Here

Examples of io.netty.channel.socket.nio.NioSocketChannel.connect()

  public static void main(String[] args) throws Exception {
    final SocketChannel ch = new NioSocketChannel();
    new NioEventLoopGroup().register(ch);
    final long start = System.currentTimeMillis();
    ch.pipeline().addLast(new RedisCommandEncoder(), new RedisReplyDecoder());
    ch.connect(new InetSocketAddress("localhost", 6379)).addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture channelFuture) throws Exception {
        write(ch);
      }
    });
View Full Code Here

Examples of io.socket.SocketIO.connect()

    }
  }

  public BasicExample2() throws Exception {
    SocketIO socket = new SocketIO("http://127.0.0.1:3001/");
    socket.connect(new IOCallback() {
      @Override
      public void onMessage(JSONObject json, IOAcknowledge ack) {
        try {
          System.out.println("Server said:" + json.toString(2));
        } catch (JSONException e) {
View Full Code Here

Examples of io.undertow.client.HttpClient.connect()

        }
        exchange.dispatch(SameThreadExecutor.INSTANCE, new Runnable() {
            @Override
            public void run() {
                HttpClient client = HttpClient.create(exchange.getConnection().getWorker(), OptionMap.EMPTY);
                client.connect(exchange.getIoThread(), destination, OptionMap.EMPTY).addNotifier(new ConnectNotifier(nextHandler), exchange);
            }
        });
    }

View Full Code Here

Examples of io.undertow.client.UndertowClient.connect()

        DefaultServer.setRootHandler(SIMPLE_MESSAGE_HANDLER);
        final UndertowClient client = createClient();

        final List<ClientResponse> responses = new CopyOnWriteArrayList<>();
        final CountDownLatch latch = new CountDownLatch(10);
        final ClientConnection connection = client.connect(ADDRESS, worker, new ByteBufferSlicePool(1024, 1024), OptionMap.EMPTY).get();
        try {
            connection.getIoThread().execute(new Runnable() {
                @Override
                public void run() {
                    for (int i = 0; i < 10; i++) {
View Full Code Here

Examples of io.undertow.websockets.utils.WebSocketTestClient.connect()

    public void testStringOnMessage() throws Exception {
        final byte[] payload = "hello".getBytes();
        final FutureResult latch = new FutureResult();

        WebSocketTestClient client = new WebSocketTestClient(WebSocketVersion.V13, new URI("ws://" + DefaultServer.getHostAddress("default") + ":" + DefaultServer.getHostPort("default") + "/ws/chat/Stuart"));
        client.connect();
        client.send(new TextWebSocketFrame(ChannelBuffers.wrappedBuffer(payload)), new FrameChecker(TextWebSocketFrame.class, "hello Stuart".getBytes(), latch));
        latch.getIoFuture().get();
        client.destroy();
    }
View Full Code Here

Examples of io.vertx.rxcore.java.net.RxNetClient.connect()

    listenObs.subscribe(new Action1<RxNetServer>() {
      @Override
      public void call(RxNetServer rxNs) {
        assertTrue(rxNetServer == rxNs);
        RxNetClient rxNetClient = new RxNetClient(vertx.createNetClient());
        Observable<RxNetSocket> connectObs = rxNetClient.connect(1234);
        connectObs.subscribe(new Action1<RxNetSocket>() {
          @Override
          public void call(RxNetSocket rxNetSocket) {
            rxNetSocket.coreSocket().write("somedata");
            rxNetSocket.asObservable().subscribe(new Action1<Buffer>() {
View Full Code Here

Examples of irc4j.IRC4J.connect()

        config.setRealName("IRC4J");
        config.setUsername("IRC4J");
        IRC4J bot = config.create();
        bot.setEventListener(new TestEventListener());
        try {
            bot.connect();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
View Full Code Here

Examples of it.baeyens.arduino.arduino.Serial.connect()

     */
    @Override
    public void ResumePort(String PortName) {
  Serial TheSerial = GetSerial(PortName);
  if (TheSerial != null) {
      TheSerial.connect();
  }
    }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.