Package ch.usi.dslab.bezerra.netwrapper.tcp

Examples of ch.usi.dslab.bezerra.netwrapper.tcp.TCPReceiver.receive()


      sender.send(message, serverConnection);

      TCPReceiver receiver = new TCPReceiver();
      receiver.addConnection(serverConnection);

      TCPMessage msg = receiver.receive();
      String reply = (String) msg.getContents().getItem(0);
      System.out.println("Reply received: " + reply);

      Message message2 = new Message(new String("second message from client"));
View Full Code Here


      Message message2 = new Message(new String("second message from client"));

      sender.send(message2, serverConnection);

      TCPMessage msg2 = receiver.receive();
      String reply2 = (String) (msg2.getContents().getItem(0));
      System.out.println("Reply received: " + reply2);
     
      sender.stop();
      receiver.stop();
View Full Code Here

   public static void main(String[] args) {
      TCPReceiver receiver = new TCPReceiver(50000);
      TCPSender   sender   = new TCPSender  ();
     
      while(!Thread.interrupted()) {
         TCPMessage msg = receiver.receive();
         String recvdMessage = (String) msg.getContents().getItem(0);
         System.out.println("Received message: " + recvdMessage);
         Message ack = new Message(new String("Ack for message \"" + recvdMessage + "\""));
         sender.send(ack, msg.getConnection());
      }
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.