diff options
author | burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-14 21:33:07 +0000 |
---|---|---|
committer | burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-14 21:33:07 +0000 |
commit | 2b293ebe7586687df2df9c87eb1b05697b4d318a (patch) | |
tree | 075b8dea7e2e3dcce95606103edbe3f57553871f /include/socketengine_iocp.h | |
parent | bbf6f3c5d25b1569e20f6cb59898f33137ba2226 (diff) |
- Fixed UDP Overlapped I/O under windows. (not the best way this could be done by far, but probably the best that is possible with our EventHandler setup). *dns will now work under win32* :)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7313 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socketengine_iocp.h')
-rw-r--r-- | include/socketengine_iocp.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/socketengine_iocp.h b/include/socketengine_iocp.h index 615c44fd7..5de7af03f 100644 --- a/include/socketengine_iocp.h +++ b/include/socketengine_iocp.h @@ -14,7 +14,7 @@ #ifndef __SOCKETENGINE_IOCP__ #define __SOCKETENGINE_IOCP__ -#define READ_BUFFER_SIZE 500 +#define READ_BUFFER_SIZE 600 #define USING_IOCP 1 #include "inspircd_config.h" @@ -37,7 +37,11 @@ class Overlapped public: OVERLAPPED m_overlap; SocketIOEvent m_event; - int m_params; +#ifdef WIN64 + unsigned __int64 m_params; +#else + unsigned long m_params; +#endif Overlapped(SocketIOEvent ev, int params) : m_event(ev), m_params(params) { @@ -45,6 +49,14 @@ class Overlapped } }; +struct udp_overlap +{ + unsigned char udp_buffer[600]; + unsigned long udp_len; + sockaddr udp_sockaddr[2]; + unsigned long udp_sockaddr_len; +}; + struct accept_overlap { int socket; @@ -173,6 +185,11 @@ public: * @return A pointer to the event handler, or NULL */ EventHandler* GetIntRef(int fd); + + /** Holds the preallocated buffer passed to WSARecvFrom
+ * function. Yes, I know, it's a dirty hack.
+ */
+ udp_overlap * udp_ov;
}; //typedef void(*OpHandler)(EventHandler) |