* fhandler_socket.cc (fhandler_socket::connect): Don't restrict

WSAEINVAL -> WSAEISCONN conversion to nonblocking sockets.
	(fhandler_socket::accept): Use event driven technique to implement
	interuptible accept.
	(fhandler_socket::wait): Allow FD_ACCEPT handling.
	* net.cc (cygwin_accept): Remove workaround for allowing blocking
	accept.  That's entirely in fhandler_socket::accept now.
This commit is contained in:
Corinna Vinschen
2005-10-22 16:02:15 +00:00
parent 152a9caf58
commit c2c020d1fb
3 changed files with 35 additions and 16 deletions

View File

@ -909,19 +909,7 @@ cygwin_accept (int fd, struct sockaddr *peer, int *len)
if (efault.faulted (EFAULT) || !fh)
res = -1;
else
{
if (!fh->is_nonblocking ())
{
size_t fds_size = howmany (fd + 1, NFDBITS) * sizeof (fd_mask);
fd_set *read_fds = (fd_set *) alloca (fds_size);
memset (read_fds, 0, fds_size);
FD_SET (fd, read_fds);
res = cygwin_select (fd + 1, read_fds, NULL, NULL, NULL);
if (res == -1)
return -1;
}
res = fh->accept (peer, len);
}
res = fh->accept (peer, len);
syscall_printf ("%d = accept (%d, %p, %p)", res, fd, peer, len);
return res;