K
Karstens Rage
I have a simple multicast server using MulticastSocket and a joinGroup
and a simple client that uses DatagramSocket to send to that multicast
group (as a simple IP address). I also have a client in C running on
another host. If I run the C client the server only gets one datagram
packet and responds correctly. If I run the Java client on the same host
as the server, the server seems to get two packets from the same client.
I doubt the client is actually sending two packets. I think what may be
happening is that the network stack is passing two packets up (maybe one
from localhost and one from the network address of the machine).
I have fiddled with setNetworkInterface, setLoopbackMode (true and
false), and fiddling with the receive buffer for the actual call to
receive on the socket to no avail. I notice that if I set loopback to
true (disable), on the server, then the local Java client will not work
(just hangs in receive from the server and the server never gets anything)
Can anyone explain what is going on on the local host? Is there a
workaround so that server only gets one packet from the local client?
k
btw, using
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)
and a simple client that uses DatagramSocket to send to that multicast
group (as a simple IP address). I also have a client in C running on
another host. If I run the C client the server only gets one datagram
packet and responds correctly. If I run the Java client on the same host
as the server, the server seems to get two packets from the same client.
I doubt the client is actually sending two packets. I think what may be
happening is that the network stack is passing two packets up (maybe one
from localhost and one from the network address of the machine).
I have fiddled with setNetworkInterface, setLoopbackMode (true and
false), and fiddling with the receive buffer for the actual call to
receive on the socket to no avail. I notice that if I set loopback to
true (disable), on the server, then the local Java client will not work
(just hangs in receive from the server and the server never gets anything)
Can anyone explain what is going on on the local host? Is there a
workaround so that server only gets one packet from the local client?
k
btw, using
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)