title: seems that my receive method does't get packet on multicast socket in java
body: <p>I have a problem with receive method while using multicast socket in java. there are some hosts that they want to have a group chat using multicast socket.two threads (Read &amp; Write) are started on each host, and both of them using multicast socket which joins to a group IP.
  the problem is that when the receive method execute, it doesn't return the Datagram packet which has been sent before from the other host on it's write thread.what's the problem?
  here is some code in run method of read thread:</p>
  
  <pre><code>byte buff[]=new byte[576];
  DatagramPacket DataPkt=new DatagramPacket(buff, 576);
  MultiReadSocket.receive(DataPkt);
  System.out.println("Datagram Packet: " + DataPkt);
  ByteArrayInputStream bais = new ByteArrayInputStream(buff);
  ObjectInputStream ois = new ObjectInputStream(bais);
  MyPkt = (MyPacket)ois.readObject();
  </code></pre>
  
  <p>code in run method of write thread:</p>
  
  <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();
  ObjectOutputStream oos = new ObjectOutputStream(baos);
  oos.writeObject(MyPkt);
  DatagramPacket DataPkt = new DatagramPacket(baos.toByteArray(),    baos.toByteArray().length,InetAddress.getByName("235.0.0.2"), 2020);
  MultiWriteSocket.send(DataPkt);
  </code></pre>
  
  <p>if more information needed, please tell me.</p>