Re: Can you select() socketpair()-generated descriptors?

From: Andrew Taylor (ataylor_at_its.to)
Date: 09/29/04


Date: Wed, 29 Sep 2004 20:11:32 GMT

Jo wrote:

> I'm pulling my hair out over trying to get a socket passed from one
> process to another. My latest problem is in getting the receiving
> process to detect the incoming socket. 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. 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()?

The second parameter to socketpair is wrong. You should be passing a
socket type (e.g. SOCK_STREAM, SOCK_DGRAM, etc.).

-- 
Andrew


Relevant Pages

  • Re: reading a fixed-length message
    ... properly (close the socket, serial port, etc.) ... depending on the descriptors you are using. ... if serialfd for write ...
    (comp.unix.programmer)
  • are socket handles always usabele by file i/o functions?
    ... descriptors are IFS handles by using these descriptors ... I thought that if I create socket from WSAPROTOCOL_INFO which has not ... But it's written that if SPI does not create IFS handle, ... can read that it returns handle that can be used in file I/O functions. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Linux select command issues
    ... double-check any descriptors (by referring ... It comes down to whether or not 'select' is a pure status reporting ... If it's a pure status reporting function, ... What would happen if you 'select'ed for write on a socket that wasn't ...
    (comp.unix.programmer)
  • Re: Sockets and threads...
    ... Mark Seger wrote: ... Are you opening sockets "internally" from one ... I had tried to share descriptors and failed ... That only works if you only need to write on the socket. ...
    (comp.lang.perl.misc)
  • Can you select() socketpair()-generated descriptors?
    ... I'm pulling my hair out over trying to get a socket passed from one ... My latest problem is in getting the receiving ... all the socket descriptors and pipe descriptors, ...
    (comp.os.linux.development.apps)