diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-17 19:29:11 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-17 19:29:11 +0000 |
commit | 455d6fac2e047a9d544e455e0cced8fe94a9d95b (patch) | |
tree | 94b3f0dde6e35bc71a855fe93deab6b3b6ca81fd /include/socket.h | |
parent | ad2829e7c482ac0c70a9bc524529adb883cd6b1b (diff) |
Comments
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7382 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socket.h')
-rw-r--r-- | include/socket.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/socket.h b/include/socket.h index db0aa7f92..57725b95f 100644 --- a/include/socket.h +++ b/include/socket.h @@ -39,15 +39,22 @@ /* Accept Define */ #ifdef CONFIG_USE_IOCP +/* IOCP wrapper for accept() */ #define _accept(s, addr, addrlen) __accept_socket(s, addr, addrlen, m_acceptEvent) +/* IOCP wrapper for getsockname() */ #define _getsockname(fd, sockptr, socklen) __getsockname(fd, sockptr, socklen, m_acceptEvent) +/* IOCP wrapper for recvfrom() */ #define _recvfrom(s, buf, len, flags, from, fromlen) __recvfrom(s, buf, len, flags, from, fromlen, ((IOCPEngine*)ServerInstance->SE)->udp_ov) #else +/* No wrapper for recvfrom() */ #define _recvfrom recvfrom +/* No wrapper for accept() */ #define _accept accept +/* No wrapper for getsockname() */ #define _getsockname getsockname #endif +/* Contains irc-specific definitions */ namespace irc { /** This namespace contains various protocol-independent helper classes. @@ -170,9 +177,13 @@ class CoreExport ListenSocket : public EventHandler /** The creator/owner of this object */ InspIRCd* ServerInstance; + /** Socket description (shown in stats p) */ std::string desc; + /** Socket address family */ int family; + /** Address socket is bound to */ std::string bind_addr; + /** Port socket is bound to */ int bind_port; public: /** Create a new listening socket @@ -190,17 +201,20 @@ class CoreExport ListenSocket : public EventHandler { desc = description; } - + /** Get description for socket + */ const std::string& GetDescription() { return desc; } - + /** Get port number for socket + */ int GetPort() { return bind_port; } - + /** Get IP address socket is bound to + */ std::string &GetIP() { return bind_addr; @@ -208,3 +222,4 @@ class CoreExport ListenSocket : public EventHandler }; #endif + |