summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/socket.h17
1 files changed, 13 insertions, 4 deletions
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 <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <sstream>
#include <string>
-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();
};