lkml.org 
[lkml]   [1999]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsocket(AF_UNIX,SOCK_STREAM,0) & accept()

Hi,
As someone already have pointed out :

main()
{
s = socket(AF_UNIX,SOCK_STREAM,0);
bind(s,.....);
listen(s,5);
accept(s,.....); <--- doesn't block
....
}

but with select(2) it blocks :) Just checked.

I suspect problem is here :

net/core/datagram.c
static int wait_for_packet(struct sock * sk, int *err)
{
....
error = -ENOTCONN;
if(connection_based(sk) && sk->state!=TCP_ESTABLISHED)
goto out; ^^^^^^^^^^^^^^^ should be TCP_LISTEN ?

....
}

:) Just curious if I'm right.

ps.
Or maybe it's even intended behaviour ?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.049 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site