Path: csiph.com!usenet.pasdenom.info!news.chainon-marquant.org!gegeweb.org!aioe.org!.POSTED!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.programmer Subject: Re: Strange Socket problem Date: Sat, 03 Mar 2012 09:08:53 +0000 Organization: Aioe.org NNTP Server Lines: 52 Message-ID: <5m3929-6b4.ln1@s.simpson148.btinternet.com> References: <5j4529-ln2.ln1@s.simpson148.btinternet.com> <9ab529-1r3.ln1@s.simpson148.btinternet.com> NNTP-Posting-Host: SYma/1Oij9bhI+errvtPhg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:12622 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. -- ss at comp dot lancs dot ac dot uk