diff options
Diffstat (limited to 'src/Net/ClientConnection.cpp')
-rw-r--r-- | src/Net/ClientConnection.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Net/ClientConnection.cpp b/src/Net/ClientConnection.cpp index d818f7e..695cba5 100644 --- a/src/Net/ClientConnection.cpp +++ b/src/Net/ClientConnection.cpp @@ -56,13 +56,18 @@ void ClientConnection::connect(const IPAddress &address, bool daemon0) throw(Con daemon = daemon0; if(isConnected()) - disconnect(); + return; + // TODO Error sock = socket(PF_INET, SOCK_STREAM, 0); if(sock < 0) throw ConnectionException("socket()", std::strerror(errno)); + if(peer) + delete peer; peer = new IPAddress(address); + authenticated = false; + identified = false; if(::connect(sock, peer->getSockAddr(), peer->getSockAddrLength()) < 0) { close(sock); |