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

Examples of ch.usi.dslab.bezerra.netwrapper.tcp.TCPConnection


public class SimpleTcpClient {

   public static void main(String[] args) throws InterruptedException, IOException {
      Message message = new Message(new String("message from client"));
      System.out.println("Message class name: " + Message.class.getName());
      TCPConnection serverConnection = new TCPConnection("localhost", 50000);
      serverConnection.sendBusyWait(message);

      Message rawReply = serverConnection.receiveBusyWait();
      String reply = (String) rawReply.getItem(0);
      System.out.println("Reply received: " + reply);
   }
View Full Code Here


   public static void main(String[] args) throws InterruptedException, IOException {
      TCPSender sender = new TCPSender();
     
      Message message = new Message(new String("first message from client"));
      TCPConnection serverConnection = new TCPConnection("localhost", 50000);

      sender.send(message, serverConnection);

      TCPReceiver receiver = new TCPReceiver();
      receiver.addConnection(serverConnection);
View Full Code Here

TOP

Related Classes of ch.usi.dslab.bezerra.netwrapper.tcp.TCPConnection

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.