summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 67ff65c70..aa028b8a5 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -94,6 +94,8 @@ InspSocket::InspSocket(std::string host, int port, bool listening, unsigned long
ip = inet_ntoa(*ia);
}
+ this->IP = ip;
+
timeout_end = time(NULL)+maxtime;
timeout = false;
if ((this->fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
@@ -138,6 +140,11 @@ void InspSocket::Close()
}
}
+std::string InspSocket::GetIP()
+{
+ return this->IP;
+}
+
char* InspSocket::Read()
{
int n = recv(this->fd,this->ibuf,sizeof(this->ibuf),0);