Re: Can you select() socketpair()-generated descriptors?
From: Brian Raiter (blr_at_drizzle.com)
Date: 09/29/04
- Next message: Jo: "Descriptor passed w/SCM_RIGHTS is invalid"
- Previous message: Andrew Taylor: "Re: Can you select() socketpair()-generated descriptors?"
- In reply to: Jo: "Can you select() socketpair()-generated descriptors?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Sep 2004 20:15:21 +0000 (UTC)
> I'm using select() as I do with all the socket descriptors and pipe
> descriptors, but it just times out, as though the socket was never
> sent.
It is almost certainly a bug in your code. Did you remember to set the
first argument to select() to be the value of your largest file
descriptor PLUS one? Did you remember to re-initialize your file
descriptor masks before EVERY call to select()?
> If I create a set of descriptors using socketpair(AF_UNIX,
> SOL_SOCKET, 0, desAncils), does select() treat those descriptors the
> same as those created with pipe(), accept() or connect()?
Yes. Or open(). Or the 0, 1, and 2 descriptors automatically created
for you. As far as select() is concerned, a file descriptor is a file
descriptor is a file descriptor. You can select() on all of them.
b
- Next message: Jo: "Descriptor passed w/SCM_RIGHTS is invalid"
- Previous message: Andrew Taylor: "Re: Can you select() socketpair()-generated descriptors?"
- In reply to: Jo: "Can you select() socketpair()-generated descriptors?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|