summaryrefslogtreecommitdiff
path: root/src/Socket.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Socket.cc')
-rw-r--r--src/Socket.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Socket.cc b/src/Socket.cc
index 100b94e..7511bde 100644
--- a/src/Socket.cc
+++ b/src/Socket.cc
@@ -250,7 +250,7 @@ static DNSRequest resolveName(const char * name, const char * service = NULL, st
return req;
}
-Balau::Socket::Socket() throw (GeneralException) : m_fd(socket(AF_INET6, SOCK_STREAM, 0)), m_connected(false), m_connecting(false), m_listening(false) {
+Balau::Socket::Socket() throw (GeneralException) : m_fd(socket(AF_INET6, SOCK_STREAM, 0)) {
m_name = "Socket(unconnected)";
RAssert(m_fd >= 0, "socket() returned %i", m_fd);
m_evtR = new SocketEvent(m_fd, ev::READ);
@@ -271,8 +271,9 @@ Balau::Socket::Socket() throw (GeneralException) : m_fd(socket(AF_INET6, SOCK_ST
Printer::elog(E_SOCKET, "Creating a socket at %p", this);
}
-Balau::Socket::Socket(int fd) : m_fd(fd), m_connected(true), m_connecting(false), m_listening(false) {
+Balau::Socket::Socket(int fd) : m_fd(fd) {
socklen_t len;
+ m_connected = true;
len = sizeof(m_localAddr);
getsockname(m_fd, (sockaddr *) &m_localAddr, &len);