Handle shutdown

This commit is contained in:
James Booth
2015-05-24 00:55:39 +01:00
parent ed7e7e9670
commit 23cbdc9013
8 changed files with 48 additions and 27 deletions

View File

@@ -28,8 +28,8 @@ xmppclient_end_session(XMPPClient *client)
{
if (client) {
if (client->sock) {
while (recv(client->sock, NULL, 1, 0) > 0) {}
shutdown(client->sock, 2);
while (recv(client->sock, NULL, 1, 0) > 0) {}
close(client->sock);
}
free(client->ip);