Tidied socket reads/writes

This commit is contained in:
James Booth
2015-05-12 00:15:52 +01:00
parent d392c77b03
commit 39fe147a8a
2 changed files with 120 additions and 144 deletions

View File

@@ -24,6 +24,8 @@ xmppclient_new(struct sockaddr_in client_addr, int socket)
void
xmppclient_end_session(XMPPClient *client)
{
while (recv(client->sock, NULL, 1, 0) > 0) {}
shutdown(client->sock, 2);
close(client->sock);
free(client->ip);