Socket returned by accept function of Microsoft API should keep the

properties of the listening socket. This is also true for non-blocking
property.
This commit is contained in:
Stephane Lussier 2000-09-27 22:27:33 +00:00 committed by Alexandre Julliard
parent 8e2643687d
commit 0d5f1ab2d9
1 changed files with 4 additions and 0 deletions

View File

@ -338,8 +338,12 @@ static struct object *accept_socket( int handle )
return NULL;
}
/* newly created socket gets the same properties of the listening socket */
fcntl(acceptfd, F_SETFL, O_NONBLOCK); /* make socket nonblocking */
acceptsock->obj.fd = acceptfd;
acceptsock->state = WS_FD_CONNECTED|WS_FD_READ|WS_FD_WRITE;
if (sock->state & WS_FD_NONBLOCKING)
acceptsock->state |= WS_FD_NONBLOCKING;
acceptsock->mask = sock->mask;
acceptsock->hmask = 0;
acceptsock->pmask = 0;