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:
@ -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);
|
||||
|
Reference in New Issue
Block a user