mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2025-02-18 05:16:19 +01:00
Small bug fix, close socket
This commit is contained in:
parent
978f0ce537
commit
1fc28d9bbf
@ -614,7 +614,7 @@ void NetworkServer::RemoveClient(NetworkClient *client)
|
|||||||
/* Swap with last */
|
/* Swap with last */
|
||||||
this->clients[i] = this->clients[this->n_clients - 1];
|
this->clients[i] = this->clients[this->n_clients - 1];
|
||||||
}
|
}
|
||||||
delete this->clients[i];
|
delete client;
|
||||||
this->n_clients--;
|
this->n_clients--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -636,6 +636,7 @@ NetworkClient::NetworkClient(int sock) : Network()
|
|||||||
NetworkClient::~NetworkClient()
|
NetworkClient::~NetworkClient()
|
||||||
{
|
{
|
||||||
free(this->screen);
|
free(this->screen);
|
||||||
|
this->CloseSocket(this->sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkClient::Disconnect()
|
void NetworkClient::Disconnect()
|
||||||
|
@ -67,6 +67,8 @@ public:
|
|||||||
this->bytes_sent = 0;
|
this->bytes_sent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CloseSocket(int sock);
|
||||||
|
|
||||||
bool SendUpdate(int sock);
|
bool SendUpdate(int sock);
|
||||||
|
|
||||||
bool ReceiveUpdate(int sock);
|
bool ReceiveUpdate(int sock);
|
||||||
|
@ -200,3 +200,8 @@ bool Network::Select(int sock, struct timeval *tv)
|
|||||||
/* v is 0 if the sock is not ready */
|
/* v is 0 if the sock is not ready */
|
||||||
return v > 0;
|
return v > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Network::CloseSocket(int sock)
|
||||||
|
{
|
||||||
|
close(sock);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user