Examples of send()


Examples of io.undertow.io.Sender.send()

                if (codes == null ? exchange.getResponseCode() >= 400 : codes.contains(Integer.valueOf(exchange.getResponseCode()))) {
                    final String errorPage = "<html><head><title>Error</title></head><body>" + exchange.getResponseCode() + " - " + StatusCodes.getReason(exchange.getResponseCode()) + "</body></html>";
                    exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, "" + errorPage.length());
                    exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html");
                    Sender sender = exchange.getResponseSender();
                    sender.send(errorPage);
                    return true;
                }
                return false;
            }
        });
View Full Code Here

Examples of io.undertow.websockets.core.WebSocketChannel.send()

        for (int i = 0; i < LONG_MSG; i++) {
            longMsg.append(new Integer(i).toString().charAt(0));
        }

        StreamSinkFrameChannel sendChannel = clientChannel.send(WebSocketFrameType.TEXT, LONG_MSG);
        new StringWriteChannelListener(longMsg.toString()).setup(sendChannel);

        latch.await(10, TimeUnit.SECONDS);
        Assert.assertEquals(longMsg.toString(), result.get());
        clientChannel.sendClose();
View Full Code Here

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

        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.eventbus.RxEventBus.send()

      @Override
      public void call(RxMessage<String> message) {
        message.reply("pong!");
      }
    });
    Observable<RxMessage<String>> obs = rxEventBus.send("foo", "ping!");
    obs.subscribe(new Action1<RxMessage<String>>() {
      @Override
      public void call(RxMessage<String> message) {
        assertEquals("pong!", message.body());
        testComplete();
View Full Code Here

Examples of it.freedomotic.bus.BusService.send()

            PluginHasChanged event =
                    new PluginHasChanged(ClientStorageInMemory.class,
                    c.getName(), PluginActions.ENQUEUE);
            final BusService busService = Freedomotic.INJECTOR.getInstance(BusService.class);
            busService.send(event);
            LOG.log(Level.CONFIG,
                    "{0} added to plugins list.",
                    c.getName());
        }
    }
View Full Code Here

Examples of it.freedomotic.serial.SerialConnectionProvider.send()

            System.out.println("etx: " + ETX);
            System.out.println("pos eso");
            String msg = STX + "**PON" + ETX;
            System.out.println("pos eso 222");
            System.out.println("msg: " + msg);
            String output = usb.send(msg);
            System.out.println("Salida del puerto: " + output);
            usb.disconnect();
            //assertEquals(1, 1);
            // sudo socat pty,link=/dev/ttyUSB10,waitslave,ignoreeof tcp:192.168.1.5:54321 &
            // sudo socat tcp-l:54321,reuseaddr,fork file:/dev/ttyUSB0,nonblock,waitlock=/var/run/ttyUSB0.lock
View Full Code Here

Examples of it.unito.di.artifact.CommunicationArtifact.CARole.send()

        if (r < 50)
          test.setPerformative(ACLMessage.INFORM);
        else
          test.setPerformative(ACLMessage.AGREE);
                       
        user.send(test);
               
      }
    });
  }
 
View Full Code Here

Examples of java.net.DatagramSocket.send()

    DatagramPacket packetOut = makeDatagramPacket(request, port);
   
    DatagramSocket socket = getSocket();
    for (int i = 1; i <= getRetryCount(); i++) {
      try {
        socket.send(packetOut);
        socket.receive(packetIn);
        return makeRadiusPacket(packetIn, request);
      } catch (IOException ioex) {
        if (i == getRetryCount()) {
          if (logger.isErrorEnabled()) {
View Full Code Here

Examples of java.net.MulticastSocket.send()

                        String msg = IOUtils.readStringFromStream(ins);
                        msg = msg.replace("urn:uuid:883d0d53-92aa-4066-9b6f-9eadb1832366",
                                          incoming);
                        byte out[] = msg.getBytes("UTF-8");
                        DatagramPacket outp = new DatagramPacket(out, 0, out.length, sa);
                        s.send(outp);
                    }
                   
                    s.close();
                } catch (Throwable t) {
                    t.printStackTrace();
View Full Code Here

Examples of java.nio.channels.DatagramChannel.send()

        context.put("connection", connection);
        context.setRemoteEntityID(connection.id);
        kryo.writeClassAndObject(writeBuffer, object);
        writeBuffer.flip();
        int length = writeBuffer.limit();
        datagramChannel.send(writeBuffer, address);

        lastCommunicationTime = System.currentTimeMillis();

        boolean wasFullWrite = !writeBuffer.hasRemaining();
        return wasFullWrite ? length : -1;
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.