I do this for connecting to ADAM modules which are running MODBUS servers on port 502.
I use threads as the tcp timeouts in Win32 don't work since I have to connect to 27 of these. it takes about about 20 seconds for the thread to timeout and die if the host I'm trying to connect to isn't there...and that's fine, works for me. What are you doing that it takes 5 minutes to timeout? Cheers, John > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of ajpeck > Sent: Thursday, August 25, 2005 3:58 PM > To: Perl Win32 mail list > Subject: Re: [threads] Forced termination > > > The problem is that I need to reclaim the memory resource of > the thread > that is not needed no more, so I can start off a new thread. > Thus detach > is not suitable in this case. > > Alun > > John Serink wrote: > > >Just detach them and forget about them. > >other than that, I don't think there's a way to terminate them. > > > > > > > >>-----Original Message----- > >>From: [EMAIL PROTECTED] > >>[mailto:[EMAIL PROTECTED] On > >>Behalf Of ajpeck > >>Sent: Thursday, August 25, 2005 3:02 PM > >>To: Perl Win32 mail list > >>Subject: [threads] Forced termination > >> > >> > >>Is there a way to forcibly terminate a thread after a specified time > >>regardless if the thread is finished executing. I have > threads which > >>call certain network functions that have very long hard coded > >>timeouts, > >>such as 5 mins. A no response of 5 secs is sufficient for > me to know > >>that there is a problem and the nature of it is not needed (device > >>switched off, network break, etc). These threads only write > >>out a status > >>result (threads::shared variable) at the very end of the thread > >>execution, thus terminating the thread early from within the parent > >>thread and with no result written is good enough for me to > know that > >>there is a problem. > >> > >>Is there a way to impliment timed thread termination, if so I would > >>appreciate it very much for a very simple example. > >> > >>Thanx > >> > >>-- > >>Alun Peck > >>Section Head: Computers > >>Department of Mathematical Technology > >>Faculty of Natural Sciences > >>Tshwane University of Technology > >>[EMAIL PROTECTED] > >>Tel: (012) 318 6389 > >>Fax: (012) 318 6114 > >> > >>_______________________________________________ > >>Perl-Win32-Users mailing list > >>Perl-Win32-Users@listserv.ActiveState.com > >>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > >> > >> > >> > > _______________________________________________ > Perl-Win32-Users mailing list > Perl-Win32-Users@listserv.ActiveState.com > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs