On 02/03/12 00:32, Knute Johnson wrote:
On 3/1/2012 2:54 PM, Steven Simpson wrote:
I'm thinking that maybe a listener is throwing an unchecked exception.
It cycles fine until it hangs.
I'm trying to understand what 'fine' is, and how much of the failing
cycle appears fine before it fails. The previous 'fine' cycle must end
with a "Disconnected" message. The failing cycle might get as far as
printing "Connected", before jumping to the "Disconnected" message.
It's just that when you say "it just prints 'Disconnected'", you're
obviously truncating the entire trace to something manageable, but I
can't distinguish these cases:
* You're just showing the last message.
* You're showing all messages in the final cycle, and they happen to
include only one message.
These would be distinguishable by truncating just before the last
message of the previous cycle. The first case would then be indicated by:
Disconnected
Disconnected
...and the second case by:
Disconnected
Connected
Disconnected
I suppose you mean that it's the first case by this:
********* I know that the line below is not being executed **********
fireConnectionEvent(ConnectionEvent.CONNECTED);
socket.setSoTimeout(3600000); // one hour timeout
System.out.println("SportsWinClient: Connected");
...but I'm not clear on how you know this.
Perhaps you have a listener for the ConnectionEvent, and you can see
that it doesn't execute. But that could also mean that it or an earlier
listener in the chain has thrown an unchecked exception.
fireConnectionEvent doesn't protect itself against this.
Yes I do have a listener and it doesn't hear. Once it has stopped the
listening component says it is not connected. The connect/disconnect
Disconnect message.