LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] tough programming q's (was: Re: [ILUG] Re: off-topic.....)

[ILUG] tough programming q's (was: Re: [ILUG] Re: off-topic.....)

Harry Moreau hmoreau at iona.com
Mon Apr 19 18:06:50 IST 1999


On Mon, 19 Apr 1999, kevin lyda wrote:

>programming question: i'm looking for a blocking read/recv call that
>times out.  it would be best if it didn't involve signals.  ideas?

select() is probably your only option.  Using signals is indeed a bad idea,
because you can't control the exact point at which your read() gets interrupted
by the timeout.

>also, i'm looking for this for efficiency reasons.  if i did it
>with a select and then a read it will involve more data copying
>under linux, yes?  

I don't think so.  select() doesn't actually read data.

>what about other unicies?  it would be nice if the
>solution was portable (possibly expressed using ACE).

select() is available on most modern UNIX systems.  However,
you may find slight differences in implementation, especially in error
conditions.  Read the man pages carefully.

--
-- Harry Moreau -------------




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell