----- Original Message -----
From: Orlando Andico
To: The Main Philippine Linux Users' Group (PLUG) Discussion List
Sent: Monday, November 21, 2005 2:45 PM
Subject: Re: [plug] Perl: handling blocking reads "nicely"
i'm not so sure if this will "work" consistently if there's a huge lot of
message traffic though.
it will work... however it will not timeout and always in ready state if
there is a single byte of data incoming within your timeout value...
if you want to implement socket timeout... you have three options and these
are...
1. as what you did.. using alarm function..
2. using either select or poll function...
3. using the newer SO_RCVTIMEO and SO_SNDTIMEO socket options... take note
that not all implementations support these two socket options...
if you dont want to implement socket timeout... you can set the socket
filedescriptor default from blocking state into non-block state using
O_NONBLOCK flag in fcntl() function...
fooler.
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph