lkml.org 
[lkml]   [2003]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: select for UNIX sockets?
    From
    Date
    On Wed, 04 Jun 2003 14:19:34 +0200, Petr Vandrovec said:

    > > > FD_ZERO(&set);
    > > > FD_SET(fd, &set);
    > > > select(FD_SETSIZE, NULL, &set, NULL, NULL); <<<<<<< for writing
    > > >
    > > > if (FD_ISSET(fd, &set))
    > > > sendto(fd, &datagram, 1, 0, ...);

    > Besides that select() on unconnected socket is nonsense... If you'll
    > change code to do connect(), select(), send(), then it should work,
    > unless I missed something.

    We FD_SET the bit, ignore the return value of select, and test if the bit is
    still set. Plenty of programming bad karma there. However, one would vaguely
    hope that the kernel would notice that the socket isn't connected and -ENOTCONN
    rather than blocking....

    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2005-03-22 13:36    [W:3.511 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site