summaryrefslogtreecommitdiff
path: root/include/socket.h
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-08 16:58:41 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-08 16:58:41 +0000
commit74f401f1997b89783217cd636f396e35f5c2a9d0 (patch)
treec988875a1ceb7ba3b3baa37d04485ac0e02988a4 /include/socket.h
parent484b718ccf1505360d62401dd09e3eca6b2568d8 (diff)
Make OnAcceptReady pure virtual, rename ListenSocket to ListenSocketBase, create ClientListenSocket and inherit from ListenSocketBase to create User objects.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10469 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socket.h')
-rw-r--r--include/socket.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/socket.h b/include/socket.h
index 1f699dbd7..961fbd98e 100644
--- a/include/socket.h
+++ b/include/socket.h
@@ -145,7 +145,7 @@ namespace irc
* It will create a new User for every valid connection
* and assign it a file descriptor.
*/
-class CoreExport ListenSocket : public EventHandler
+class CoreExport ListenSocketBase : public EventHandler
{
protected:
/** The creator/owner of this object
@@ -171,13 +171,13 @@ class CoreExport ListenSocket : public EventHandler
public:
/** Create a new listening socket
*/
- ListenSocket(InspIRCd* Instance, int port, char* addr);
+ ListenSocketBase(InspIRCd* Instance, int port, char* addr);
/** Handle an I/O event
*/
void HandleEvent(EventType et, int errornum = 0);
/** Close the socket
*/
- ~ListenSocket();
+ ~ListenSocketBase();
/** Set descriptive text
*/
void SetDescription(const std::string &description)
@@ -212,13 +212,15 @@ class CoreExport ListenSocket : public EventHandler
* @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);
+ virtual void OnAcceptReady(const std::string &ipconnectedto, int fd, const std::string &incomingip) = 0;
};
-//class CoreExport ListenSocketClient : public ListenSocket
-//{
-//
-//}
+class CoreExport ClientListenSocket : public ListenSocketBase
+{
+ virtual void OnAcceptReady(const std::string &ipconnectedto, int fd, const std::string &incomingip);
+ public:
+ ClientListenSocket(InspIRCd* Instance, int port, char* addr) : ListenSocketBase(Instance, port, addr) { }
+};
#endif