From 3f8978ceef854ab7c91e86751b61a4405c10c4c8 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 23 Nov 2005 11:22:06 +0000 Subject: Added some stuff to socket classes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1929 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/socket.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/socket.h b/include/socket.h index 3e681f1c4..499a4d375 100644 --- a/include/socket.h +++ b/include/socket.h @@ -14,10 +14,13 @@ * --------------------------------------------------- */ +#include +#include +#include #include #include -enum InspSocketState { I_DISCONNECTED, I_CONNECTING, I_CONNECTED, I_LISTENING }; +enum InspSocketState { I_DISCONNECTED, I_CONNECTING, I_CONNECTED, I_LISTENING, I_ERROR }; class InspSocket { @@ -26,13 +29,19 @@ private: std::string host; int port; InspSocketState state; + sockaddr_in addr; + in_addr addy; + time_t timeout_end; + bool timeout; public: InspSocket(); - InspSocket(std::string host, int port, bool listening); - void Poll(); + InspSocket(std::string host, int port, bool listening, unsigned long maxtime); virtual int OnConnected(); virtual int OnError(); virtual int OnDisconnect(); + virtual int OnDataReady(); virtual int OnIncomingConnection(); - ~InspSocket(); + void SetState(InspSocketState s); + void EngineTrigger(); + virtual ~InspSocket(); }; -- cgit v1.2.3