Revert code reversion from 2004-04-03. So, revert to async I/O again.

* fhandler.h (status): Add "closed" flag.
	(prepare): New method declaration.
	(wait): Ditto.
	(release): Ditto.
	* fhandler_socket.cc: Don't include wsock_event.h.
	(fhandler_socket::prepare): New method, moved from wsock_event.
	(fhandler_socket::wait): Ditto.
	(fhandler_socket::release): New method.
	(fhandler_socket::recvfrom): Simplify loop.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendto): Ditto.
	(fhandler_socket::sendmsg): Ditto.
	* net.cc: Don't include wsock_event.h.
	(wsock_event::prepare): Remove.
	(wsock_event::wait): Ditto.
	* wsock_event.h: Remove.
This commit is contained in:
Corinna Vinschen
2004-05-07 07:51:31 +00:00
parent dab22ff6e6
commit 3e101fb2cd
5 changed files with 192 additions and 142 deletions

View File

@ -340,14 +340,19 @@ class fhandler_socket: public fhandler_base
unsigned async_io : 1; /* async I/O */
unsigned saw_shutdown_read : 1; /* Socket saw a SHUT_RD */
unsigned saw_shutdown_write : 1; /* Socket saw a SHUT_WR */
unsigned closed : 1;
unsigned connect_state : 2;
public:
status_flags () :
async_io (0), saw_shutdown_read (0), saw_shutdown_write (0),
connect_state (unconnected)
closed (0), connect_state (unconnected)
{}
} status;
bool prepare (HANDLE &event, long event_mask);
int wait (HANDLE event);
void release (HANDLE event);
public:
fhandler_socket ();
~fhandler_socket ();
@ -357,6 +362,7 @@ class fhandler_socket: public fhandler_base
IMPLEMENT_STATUS_FLAG (bool, async_io)
IMPLEMENT_STATUS_FLAG (bool, saw_shutdown_read)
IMPLEMENT_STATUS_FLAG (bool, saw_shutdown_write)
IMPLEMENT_STATUS_FLAG (bool, closed)
IMPLEMENT_STATUS_FLAG (conn_state, connect_state)
int bind (const struct sockaddr *name, int namelen);