81f5200ba3
* fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize has_been_closed to 0. (fhandler_socket::recvfrom): Use new asynchronous I/O driven wsock_event methods. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. * net.cc (wsock_event::prepare): Reimplement using asynchronous I/O. (wsock_event::wait): Ditto. (wsock_event::release): New method. * wsock_event.h (class wsock_event): Remove ovr member. Accomodate new implementation of prepare and wait methods. Add release method.
33 lines
673 B
C++
33 lines
673 B
C++
/* wsock_event.h: Defining the wsock_event class
|
|
|
|
Copyright 2002 Red Hat, Inc.
|
|
|
|
This file is part of Cygwin.
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
details. */
|
|
|
|
#ifndef __WSOCK_EVENT_H__
|
|
#define __WSOCK_EVENT_H__
|
|
|
|
class wsock_event
|
|
{
|
|
WSAEVENT event;
|
|
public:
|
|
wsock_event () : event (NULL) {};
|
|
~wsock_event ()
|
|
{
|
|
if (event)
|
|
WSACloseEvent (event);
|
|
event = NULL;
|
|
};
|
|
|
|
/* The methods are implemented in net.cc */
|
|
bool prepare (int sock, long event_mask);
|
|
int wait (int sock, int &closed);
|
|
void release (int sock);
|
|
};
|
|
|
|
#endif /* __WSOCK_EVENT_H__ */
|