diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-15 02:19:06 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-15 02:19:06 +0200 |
commit | fbe26b0e48e6f3714900833174fcf42196e86fc8 (patch) | |
tree | 0f9528f2ad25c50e55a13e6fd60bf545f48ebf88 /src/Net/ClientConnection.cpp | |
parent | 082dac7a8cb39ec1b005680680c4f3e1e8ddc256 (diff) | |
download | mad-fbe26b0e48e6f3714900833174fcf42196e86fc8.tar mad-fbe26b0e48e6f3714900833174fcf42196e86fc8.zip |
Identifikationsinformationen im ConnectionManager speichern
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); |