From 21c083ccc162a06305ff0e13c5af780b5019c40c Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sun, 7 Dec 2014 00:20:35 +0100 Subject: [PATCH] Added getPureSocket call to socket library for detecting piped/real socket difference. --- lib/socket.cpp | 5 +++++ lib/socket.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/socket.cpp b/lib/socket.cpp index dc554a11..00de1bd1 100644 --- a/lib/socket.cpp +++ b/lib/socket.cpp @@ -295,6 +295,11 @@ int Socket::Connection::getSocket() { return -1; } +/// Returns non-piped internal socket number. +int Socket::Connection::getPureSocket() { + return sock; +} + /// Returns a string describing the last error that occured. /// Only reports errors if an error actually occured - returns the host address or empty string otherwise. std::string Socket::Connection::getError() { diff --git a/lib/socket.h b/lib/socket.h index 5fbd5380..62de9d6a 100644 --- a/lib/socket.h +++ b/lib/socket.h @@ -75,6 +75,7 @@ namespace Socket { std::string getBinHost(); void setHost(std::string host); ///< Sets hostname for connection manually. int getSocket(); ///< Returns internal socket number. + int getPureSocket(); ///< Returns non-piped internal socket number. std::string getError(); ///< Returns a string describing the last error that occured. bool connected() const; ///< Returns the connected-state for this socket. bool isAddress(std::string addr);