/* 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.
* descriptors)
*/
CoreExport int OpenTCPSocket(char* addr, int socktype = SOCK_STREAM);
- };
-};
+ }
+}
/** This class handles incoming connections on client ports.
* It will create a new userrec for every valid connection
/** 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
{
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;
};
#endif
+