//import comm.Sender;
//import comm.Receiver;
import java.util.*;
public class Server implements Runnable
{
    Receiver r;
    Sender s;
    Object o;
    public int Ser_id,listenPort;
    Vector que=new Vector(20,5);
    public Server(int  id,int ReceiverRecport,int SenderSendPort)
    {
	//System.out.println(port);
	Ser_id=id;
	this.listenPort=ReceiverRecport;
	r=new Receiver(ReceiverRecport);
	s=new Sender(SenderSendPort); //different SenderDesport correspond to different processes
    }
  
    public void getMessage()
    {
      	      o=r.recvObjFrom();
	      //System.out.println(o);
	      que.add(o);
    }
    public void sendMessage()
    {
	//s.sendTo("helo");
    }
    public void run()
    {
	while(true)
	    {
		getMessage();
		System.out.println(que);
	    }
    }
public static void main(String args[])
{
    /*Thread t1=new Thread(new Server(args[0],args[1]));
    t1.start();
    //Server ser1=new Server(args[0],args[1]);
    //ser1.getMessage();*/
}
}











