summaryrefslogtreecommitdiff
path: root/include/socketengine.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 22:06:04 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 22:06:04 +0000
commitd0d36795e807cf72295c6e73813e0c2daa0a71e7 (patch)
tree09ae4d94ed7b6f3038d2579037fd2c7ee93a6657 /include/socketengine.h
parent61816ef0dd848225e9ec1c21c3c7a3bc03a34da9 (diff)
Craquity craq De-craq!
This is probably broken on windows, do not attempt to use there yet unless you like broken stuff. Cant say for sure as i havent even tried to build yet and most likely wont tonight. --- Abstract most of the berkely socket API out into SocketEngine derived classes. SocketEngine base class implements standard berkely sockets that 'real mens systems' like linux and freebsd have. For socketengine_iocp we implement the windows specific nonesense like the special things needed for udp and accept (ick). All this to eliminate a bunch of ifdefs. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7810 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socketengine.h')
-rw-r--r--include/socketengine.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/socketengine.h b/include/socketengine.h
index e502a8c04..46a267fb1 100644
--- a/include/socketengine.h
+++ b/include/socketengine.h
@@ -277,6 +277,38 @@ public:
* which can be handled by the socket engine.
*/
virtual bool BoundsCheckFd(EventHandler* eh);
+
+ virtual int Accept(EventHandler* fd, sockaddr *addr, socklen_t *addrlen);
+
+ virtual int Close(EventHandler* fd);
+
+ virtual int Close(int fd);
+
+ virtual int Send(EventHandler* fd, const void *buf, size_t len, int flags);
+
+ virtual int Recv(EventHandler* fd, void *buf, size_t len, int flags);
+
+ virtual int RecvFrom(EventHandler* fd, void *buf, size_t len, int flags, sockaddr *from, socklen_t *fromlen);
+
+ virtual int SendTo(EventHandler* fd, const void *buf, size_t len, int flags, const sockaddr *to, socklen_t tolen);
+
+ virtual int Connect(EventHandler* fd, const sockaddr *serv_addr, socklen_t addrlen);
+
+ virtual int Blocking(int fd);
+
+ virtual int NonBlocking(int fd);
+
+ virtual int Shutdown(EventHandler* fd, int how);
+
+ virtual int Shutdown(int fd, int how);
+
+ virtual int Bind(int fd, const sockaddr *my_addr, socklen_t addrlen);
+
+ virtual int Listen(int sockfd, int backlog);
+
+ virtual int GetSockName(EventHandler* fd, sockaddr *name, socklen_t* namelen);
+
+ virtual void RecoverFromFork();
};
#endif