aboutsummaryrefslogtreecommitdiffstats
path: root/common/network/UnixSocket.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/network/UnixSocket.cxx')
-rw-r--r--common/network/UnixSocket.cxx28
1 files changed, 3 insertions, 25 deletions
diff --git a/common/network/UnixSocket.cxx b/common/network/UnixSocket.cxx
index f464ac85..8a223e40 100644
--- a/common/network/UnixSocket.cxx
+++ b/common/network/UnixSocket.cxx
@@ -21,13 +21,11 @@
#include <config.h>
#endif
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <errno.h>
-#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -53,13 +51,12 @@ static void initSockets() {
// -=- UnixSocket
-UnixSocket::UnixSocket(int sock, bool close)
- : Socket(new FdInStream(sock), new FdOutStream(sock), true), closeFd(close)
+UnixSocket::UnixSocket(int sock)
+ : Socket(new FdInStream(sock), new FdOutStream(sock))
{
}
UnixSocket::UnixSocket(const char *path)
- : closeFd(true)
{
int sock, err, result;
sockaddr_un addr;
@@ -94,16 +91,10 @@ UnixSocket::UnixSocket(const char *path)
// Create the input and output streams
instream = new FdInStream(sock);
outstream = new FdOutStream(sock);
- ownStreams = true;
}
UnixSocket::~UnixSocket() {
- if (closeFd)
- close(getFd());
-}
-
-int UnixSocket::getMyPort() {
- return 0;
+ close(getFd());
}
char* UnixSocket::getPeerAddress() {
@@ -137,18 +128,10 @@ char* UnixSocket::getPeerAddress() {
return rfb::strDup("(unnamed UNIX socket)");
}
-int UnixSocket::getPeerPort() {
- return 0;
-}
-
char* UnixSocket::getPeerEndpoint() {
return getPeerAddress();
}
-bool UnixSocket::sameMachine() {
- return true;
-}
-
void UnixSocket::shutdown()
{
Socket::shutdown();
@@ -208,11 +191,6 @@ UnixListener::UnixListener(const char *path, int mode)
}
}
-UnixListener::UnixListener(int sock)
-{
- fd = sock;
-}
-
UnixListener::~UnixListener()
{
struct sockaddr_un addr;