+ ~ListenSocketBase();
+ /** Set descriptive text
+ */
+ void SetDescription(const std::string &description)
+ {
+ 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
+ */
+ const std::string &GetIP() { return bind_addr; }
+
+ /** Handles sockets internals crap of a connection, convenience wrapper really
+ */
+ void AcceptInternal();
+
+ /** Called when a new connection has successfully been accepted on this listener.
+ * @param ipconnectedto The IP address the connection arrived on
+ * @param fd The file descriptor of the new connection
+ * @param incomingip The IP from which the connection was made
+ */
+ virtual void OnAcceptReady(const std::string &ipconnectedto, int fd, const std::string &incomingip) = 0;
+};
+
+class CoreExport ClientListenSocket : public ListenSocketBase
+{
+ virtual void OnAcceptReady(const std::string &ipconnectedto, int fd, const std::string &incomingip);
+ public:
+ ClientListenSocket(InspIRCd* Instance, int port, const std::string &addr) : ListenSocketBase(Instance, port, addr) { }