CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Timeout for socket connect ?

 



Omicron
Deleted

Dec 21, 2000, 2:02 AM

Post #1 of 4 (1145 views)
Timeout for socket connect ? Can't Post

Hi there!

I have following Problem:
I want to connect a special Port on my server, sometimes the Firewall blocks this special port, if this happens, I want the client tocancel the 'connection-trying' after max. 2-3 sec. but I don't know how.
The Timeout(seconds) does not work, because I don't open a port, I just want to connect to a port.
Can Somebody help me, somehow ?



perlplexer
Deleted

Dec 21, 2000, 1:34 PM

Post #2 of 4 (1140 views)
Re: Timeout for socket connect ? [In reply to] Can't Post

perldoc -f alarm

--perlplexer



Kanji
User / Moderator

Dec 21, 2000, 6:40 PM

Post #3 of 4 (1138 views)
Re: Timeout for socket connect ? [In reply to] Can't Post

Depends on how you're connecting to that port. As perplexer points out, alarm() is a good start, but if you're using IO::Socket, then you can (ab)use it's timeout() method applied to the socket object or through an IO::Socket::INET object constructor.

perldoc IO::Socket for more details.



Omicron
Deleted

Jan 9, 2001, 12:41 AM

Post #4 of 4 (1091 views)
Re: Timeout for socket connect ? [In reply to] Can't Post

thank you all for your tips !
But.. nothing works.. alarm isn't supported by aktiv perl, and the timeout function in IO::socket ( Yes I am using IO::Socket to connect to an opened Port) only works, if I open a port, not if I want to connect to an opened Port...
I need Help !! I have absolutly no idea what i can try else...


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives