[Spread-users] Socket Exception when daemon dies. Cannot re-connect to Spread.

Renee Mathur Renee.Mathur at wnco.com
Mon Jul 27 15:46:56 EDT 2009


I have an application that performs like a Replicated Cache and uses
Spread 4.0 for messaging.

I have multiple instances of my application and multiple spread daemons
in the environment.


In my application I have a receive thread, that receives messages from

I have code where, if I get a socket exception on the receive thread
(the daemon has died or unable to connect to the daemon),

I do a disconnect and then, I try to connect to other daemons that may
be running.


But, once my application gets a Socket exception, when I try to
re-connect, I get an "Already Connected" SpreadException from Spread.

Looking through the Spread source code (SpreadConnection.java), I found,
if the receive gets an exception, it does not set the "connected"
Boolean to false.

Subsequent disconnect invoked by my application fails too, (since it
tries to send a Spread Message which would fail since the Socket has
been closed from the daemon), which throws another SpreadException, but
does not set connected to false. 

Subsequent connect invoked by my application, checks the connected
variable, and throws a SpreadException saying its "Already Connected".


I checked the source code for 3.17, 4.0 and 4.1, and the logic has not
changed in any of the versions.


Are there any work arounds for this situation? How can my application
connect to a different daemon once its been disconnected?

Any help/insight much appreciated!



Thank you.



Renee Mathur.


Framework Support, Technology Department,

Southwest Airlines.

Ph: (W) 214.792.4644

Email: renee.mathur at wnco.com

Website: www.southwest.com


                            ******* CONFIDENTIALITY NOTICE *******

This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended
solely for the use of the addressee. If the reader of this message
is not the intended recipient, you are hereby notified that any
reading, dissemination, distribution, copying, or other use of this
message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender
immediately and delete this message from your system. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.spread.org/pipermail/spread-users/attachments/20090727/9442240a/attachment.html 

More information about the Spread-users mailing list