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());
}