diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-06-12 14:58:33 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-06-12 14:58:33 +0200 |
commit | 5679977b5d22e22be9e4c47c4a3dcab90c1bc5a4 (patch) | |
tree | 947df8f82a46e978fd7e69df079df9eaf6d2f357 /src/Net/ClientConnection.cpp | |
parent | 99ec36989631dd116524a5fab03f1c1977870752 (diff) | |
download | mad-5679977b5d22e22be9e4c47c4a3dcab90c1bc5a4.tar mad-5679977b5d22e22be9e4c47c4a3dcab90c1bc5a4.zip |
Das Versenden von Paketen ist jetzt m?glich
Diffstat (limited to 'src/Net/ClientConnection.cpp')
-rw-r--r-- | src/Net/ClientConnection.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Net/ClientConnection.cpp b/src/Net/ClientConnection.cpp index 396c70a..66df2ea 100644 --- a/src/Net/ClientConnection.cpp +++ b/src/Net/ClientConnection.cpp @@ -20,7 +20,7 @@ #include "ClientConnection.h" #include "IPAddress.h" #include <cstring> -#include <errno.h> +#include <cerrno> #include <sys/socket.h> namespace Mad { @@ -59,10 +59,13 @@ void ClientConnection::connect(const IPAddress &address) throw(ConnectionExcepti } void ClientConnection::disconnect() { + if(!connected) + return; + gnutls_bye(session, GNUTLS_SHUT_RDWR); if(sock >= 0) { - shutdown(sock, SHUT_RDWR); /* no more receptions */ + shutdown(sock, SHUT_RDWR); close(sock); sock = -1; } |