Article View: borland.public.jbuilder.java.api
Article #2258Stopping a thread in socket.accept()
From: Stefan Bouynov
Date: Thu, 12 Apr 2001 20:51
Date: Thu, 12 Apr 2001 20:51
17 lines
1265 bytes
1265 bytes
Hi,
I was just wondering if there is a secure way to stop/pause a thread, which
is waiting for a socket connection, e.g.:
while (true) {
Socket connection = serverSocket.accept();
.......
}
I tryed several algorithms, including setting a Thread class variable, that
stops the thread, and sending a fake connection to exit the accept()
deadlock, but the socket is still 'listening'?!
Any suggestion or advice is very much appreciated!
Regards,
Stefan
Technical Details
Message-ID:
<3ad61697$1_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,2bfc89b161596ce6,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-04-12 14:16:02 PST From: "Stefan Bouynov" <bouynov@yahoo.com> Newsgroups: borland.public.jbuilder.java.api Subject: Stopping a thread in socket.accept() Date: Thu, 12 Apr 2001 23:51:55 +0300 Lines: 19 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 213.226.11.32 Message-ID: <3ad61697$1_2@dnews> X-Trace: dnews 987109015 213.226.11.32 (12 Apr 2001 13:56:55 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews