summaryrefslogtreecommitdiff
path: root/include/socketengine_iocp.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-17 19:29:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-17 19:29:11 +0000
commit455d6fac2e047a9d544e455e0cced8fe94a9d95b (patch)
tree94b3f0dde6e35bc71a855fe93deab6b3b6ca81fd /include/socketengine_iocp.h
parentad2829e7c482ac0c70a9bc524529adb883cd6b1b (diff)
Comments
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7382 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socketengine_iocp.h')
-rw-r--r--include/socketengine_iocp.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/socketengine_iocp.h b/include/socketengine_iocp.h
index 5de7af03f..01c764088 100644
--- a/include/socketengine_iocp.h
+++ b/include/socketengine_iocp.h
@@ -23,32 +23,48 @@
#include "inspircd.h"
#include "socketengine.h"
+/** Socket overlapped event types
+ */
enum SocketIOEvent
{
+ /** Read ready */
SOCKET_IO_EVENT_READ_READY = 0,
+ /** Write ready */
SOCKET_IO_EVENT_WRITE_READY = 1,
+ /** Accept ready */
SOCKET_IO_EVENT_ACCEPT = 2,
+ /** Error occured */
SOCKET_IO_EVENT_ERROR = 3,
+ /** Number of events */
NUM_SOCKET_IO_EVENTS = 4,
};
+/** Represents a windows overlapped IO event
+ */
class Overlapped
{
public:
+ /** Overlap event */
OVERLAPPED m_overlap;
+ /** Type of event */
SocketIOEvent m_event;
#ifdef WIN64
+ /** Parameters */
unsigned __int64 m_params;
#else
+ /** Parameters */
unsigned long m_params;
#endif
-
+ /** Create an overlapped event
+ */
Overlapped(SocketIOEvent ev, int params) : m_event(ev), m_params(params)
{
memset(&m_overlap, 0, sizeof(OVERLAPPED));
}
};
+/** Specific to UDP sockets with overlapped IO
+ */
struct udp_overlap
{
unsigned char udp_buffer[600];
@@ -57,12 +73,16 @@ struct udp_overlap
unsigned long udp_sockaddr_len;
};
+/** Specific to accepting sockets with overlapped IO
+ */
struct accept_overlap
{
int socket;
char buf[1024];
};
+/** Implementation of SocketEngine that implements windows IO Completion Ports
+ */
class IOCPEngine : public SocketEngine
{
/** Creates a "fake" file descriptor for use with an IOCP socket.
@@ -192,10 +212,6 @@ public:
udp_overlap * udp_ov;
};
-//typedef void(*OpHandler)(EventHandler)
-/** Event Handler Array
- */
-
/** Creates a SocketEngine
*/
class SocketEngineFactory