Article View: borland.public.jbuilder.java.api
Article #2264Re: Stopping a thread in socket.accept()
From: Stefan Bouynov
Date: Fri, 13 Apr 2001 21:20
Date: Fri, 13 Apr 2001 21:20
34 lines
2149 bytes
2149 bytes
That was exactly my problem - no matter how I tryed to stop it (even deprecated stop/resume), the port was still 'listening' ?! Strange really ... but John's suggestion did excellent work - it generates IOException, the cycle breaks and the thread stops. Regards, Stefan "Calvin R. Smith" <calvinrsmith@hotmail.com> wrote in message news:3ad73798_2@dnews... > or you could just interupt the thread. Program flow will then resume where > you catch the IntereuptedException > > "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message > news:MPG.154071da419159f798a117@forums.borland.com... > > On Thu, 12 Apr 2001 23:51:55 +0300, Stefan Bouynov wrote: > > > > > I was just wondering if there is a secure way to stop/pause a > > > thread, which is waiting for a socket connection > > > > If you close the socket, it should break out of the accept() call. > > This is how I terminate a connection thread. > > > > -- > > Regards, > > > > John McGrath [TeamB] > > > > --------------------------------------------------- > > Before sending me e-mail, please read: > > http://www.JPMcGrath.net/newsgroups/e-mail.html > >
Technical Details
Message-ID:
<3ad76eca_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!RENT.THIS.SPACE.FOR.ADVERTISING!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3ad61697$1_2@dnews> <MPG.154071da419159f798a117@forums.borland.com> <3ad73798_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,2bfc89b161596ce6 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-04-13 14:44:04 PST From: "Stefan Bouynov" <bouynov@yahoo.com> Newsgroups: borland.public.jbuilder.java.api References: <3ad61697$1_2@dnews> <MPG.154071da419159f798a117@forums.borland.com> <3ad73798_2@dnews> Subject: Re: Stopping a thread in socket.accept() Date: Sat, 14 Apr 2001 00:20:33 +0300 Lines: 36 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.20 Message-ID: <3ad76eca_2@dnews> X-Trace: dnews 987197130 213.226.11.20 (13 Apr 2001 14:25:30 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!RENT.THIS.SPACE.FOR.ADVERTISING!newsfeed01.sul.t-online.de!t-online.de!dnews