Unable to read object / cast object from ServerSocket, ObjectInputStream in java
===

in my application we try to have a communication in p2p fashion. where each node in the network sends and receive information from others.
the informations are Broad-casted to all nodes in the network.
As per the test performed by me, the Client-server both run sucessfully, when run on only one machine. but when we try to have it run in a LAN, i think the SERVER SIDE is facing PROBLEM in reading from the socket.
    

    ServerSocket listener = null;
            try {
                listener = new ServerSocket(
                        Integer.parseInt(Configuration.getConfig("loadPort")));
                listener.setSoTimeout(0);

                while (true) {
                    logger.info("Waiting for a new Load Signal...");
                    Socket client = listener.accept();
                    logger.info("New Load Signal received.");
                    new Thread(new LoadWorker(client)).start();
                 }

Int the LoadWorker thread we recieve the client i.e the socket for the connection made.
and then the following takes place.

    try {           
                ObjectInputStream oin = new ObjectInputStream(
                client.getInputStream());
                LoadObject loadObject = (LoadObject) oin.readObject();
                logger.info("from "+ loadObject.getName()); 
                
                client.getInputStream().close();
                client.close();
                oin.close();
        
    }

There is thread which sends the refreshed information of the system load i.e LoadSender as follows: 
    
    public void sendLoad(LoadObject loadObject, InetAddress ip)throws IOException {
      logger.info("in sendLoad to ip : "+ ip.toString()+ "from "+loadObject.getName() );
      Socket s = new Socket(ip, Integer.parseInt(Configuration.getConfig("loadPort")));
        ObjectOutputStream oout = new ObjectOutputStream(s.getOutputStream());
        oout.writeObject(loadObject);
        oout.close();
        //s.getOutputStream().close(); commented out because its giving error that socket closed.
        s.close();
        logger.info("Socket closed");
  }

As per the above codes the LoadObject class implements serializable and loadObject.getName() returns the name of the node from which the information has arrived.

But to my surprise, i find that :

1. When CLIENT i.e LoadSender is switched OFF, or say not invoked (purposely, to check what happens)
then loadObject.getName(); returns NULL, for node name, and other fields also. (in the second code snippet shown)

2. when the LoadSender also runs on my machine, i.e, i send loadObject from my machine to my machine.
in this case, though the sending load thread is made sleep to 60 secs, and other nodes send information at an interval of 10secs, but still, the server accepts the connection at every 10sec and displays the information of My node.
To my observation it seems, that, the server on my machine recieves the connection from the other nodes in the network, but displays the information/loadObject of my machine. Another thing which i could observe is that, as i said that it keeps displaying my node information, the displayed information is same, for six times( as interval of sending load at other nodes is 10secs and that of my node is 60secs). 

Plese help, how can i get the object read properly as it should be!!
                