Article View: comp.lang.java.programmer
Article #167Re: Netscape socket continues blocking after close()
From: Tom Hall
Date: Thu, 21 Dec 2000 00:53
Date: Thu, 21 Dec 2000 00:53
78 lines
4072 bytes
4072 bytes
Have you tried calling "interrupt" on the thread after closing the socket - maybe it will take the hint. Tom "Evil Doona Bandit" <evildoonabandit@my-deja.com> wrote in message news:91ngv3$jep$1@nnrp1.deja.com... > Hi Paul, thanks for your response. > > Unfortunately I'm still having no luck with the first thread snapping > out of it and realising that the socket has actually been closed. The > notify() call was worth a try but Netscape didn't want to cooperate. > The thing is, there are no locks being held on the socket object, and > no opportunity for deadlock of any kind - thread 2 closes the socket > and returns to being a GUI event handler thread, which leaves the > socket reading (blocking) thread as the last remaining user thread. It > is apparently still twiddling its thumbs, waiting for that next input > from the stream. It's pretty weird.. > > Anyway, I thought that this would be a fairly common operation in a > client/server situation, so surely others would have encountered this > same issue with Netscape..? > > Thanks again for the suggestion Paul, I'll keep fiddling around with it > to see what can be done. If you have any more ideas, please let me know! > > Thanks, > > EDB > > In article <WW1%5.160574$e5.123342@newsfeeds.bigpond.com>, > "Paul Murray" <pmurray@nospam.bigpond.com> wrote: > > Try doing a notify() on the socket - may or may not work, depending > on how > > blocking is implemented. > > > > -- > > -------------------------------------------------------------- > > Repent! Quit your job! Slack off! > > http://www.users.bigpond.com/pmurray > > ICQ: 26066755 > > "Evil Doona Bandit" <evildoonabandit@my-deja.com> wrote in message > > news:91hkvn$5t2$1@nnrp1.deja.com... > > > Hi, > > > > > > A small problem that I've encountered with testing an applet in > > > Netscape: > > > > > > Thread 1 blocks on the readObject() call to a (client) Socket's > input > > > stream. > > > > > > Thread 2 closes the socket, which should hopefully force Thread 2 to > > > throw an IOException, but doesn't. The socket has been closed, but > > > Thread 1 keeps blocking in Netscape v4.70, even though in Sun's > > > appletviewer and IE v5.5 it is well behaved and throws the > exception. > > > > > > Has anyone else had the same problem with Netscape? Any ideas? I > would > > > rather not change the code to put in a Socket timeout, and then > have to > > > regularly check a flag to see if the socket is due to be closed, > etc. > > > > > > Thanks in advance! > > > > > > EDB > > > > > > > > > Sent via Deja.com > > > http://www.deja.com/ > > > > > > > Sent via Deja.com > http://www.deja.com/
Technical Details
Message-ID:
<5wc06.162440$3u1.40967621@news3.rdc1.on.home.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news3.rdc1.on.home.com.POSTED!not-for-mailReferences:
<91hkvn$5t2$1@nnrp1.deja.com> <WW1%5.160574$e5.123342@newsfeeds.bigpond.com> <91ngv3$jep$1@nnrp1.deja.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,a3545717b2d82fe5 X-Google-Attributes: gid10d6db,public X-Google-Thread: 10a146,a3545717b2d82fe5 X-Google-Attributes: gid10a146,public X-Google-Thread: 113ae9,a3545717b2d82fe5 X-Google-Attributes: gid113ae9,public X-Google-ArrivalTime: 2000-12-20 16:55:58 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news3.rdc1.on.home.com.POSTED!not-for-mail From: "Tom Hall" <t.hall@home.com> Newsgroups: comp.lang.java.programmer,comp.lang.java.help,aus.computers.java References: <91hkvn$5t2$1@nnrp1.deja.com> <WW1%5.160574$e5.123342@newsfeeds.bigpond.com> <91ngv3$jep$1@nnrp1.deja.com> Subject: Re: Netscape socket continues blocking after close() Lines: 80 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <5wc06.162440$3u1.40967621@news3.rdc1.on.home.com> Date: Thu, 21 Dec 2000 00:53:21 GMT NNTP-Posting-Host: 24.112.97.243 X-Complaints-To: abuse@home.net X-Trace: news3.rdc1.on.home.com 977360001 24.112.97.243 (Wed, 20 Dec 2000 16:53:21 PST) NNTP-Posting-Date: Wed, 20 Dec 2000 16:53:21 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster