java.net.SocketException: socket
closed
at java.net.PlainDatagramSocketImpl.receive(Native Method)
at java.net.DatagramSocket.receive(DatagramSocket.java:392)
at com.evermind.net.jc.ar0(JAX)
at com.evermind.server.jms.ca.run(JAX)
at java.lang.Thread.run(Thread.java:484)
at java.net.PlainDatagramSocketImpl.receive(Native Method)
at java.net.DatagramSocket.receive(DatagramSocket.java:392)
at com.evermind.net.jc.ar0(JAX)
at com.evermind.server.jms.ca.run(JAX)
at java.lang.Thread.run(Thread.java:484)
More: Using Win2k, Orion 1.4.5
(1.4.8), RMI clustering turned on.
Explanation: My research points,
that Orion is using one and the same port to multicast and receive multicasting
messages. However, if one tries to close the sending socket, the receiving one
is also closed (not in all 100% of the cases. Approximately that happens every
25%, something to do with the synchroinization I think).
Conducting the following
experiment:
Server: An application that listens
to MultiCast packets and prints them.
Client: An application, that opens a
multicast socket on the same port as the server is receiving on, and after
sendin, closes the socket.
If the client, and the server live
on one and the same machine roughly every one of four receivings the server gets
the SocketException.
Basic solution: Don't close the
sending socket, anyway you don't need to.
Better solution: You don't have to
send from the same port number. When creating the MultiCast socket just leave
the port selection to the underlying software and hardware.
Solution three: Use one socket for
receiving, and another for sending. Leave port selection for the sending socket
to the framework. Thus you have only one port reserved for sending (in sollution
two you get a different port for every sending socket you create).
Can't help more. No source
:)
BTW. I'm still curious how to
cluster RMIs on a couple of Orions...
Be well.
Lachezar Dobrev
May the shade of the tree strengthen
you.
