mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Close sockets
This commit is contained in:
parent
0157deae61
commit
18ca71ae55
|
@ -3271,6 +3271,10 @@ void CClient::Run()
|
|||
GameClient()->OnShutdown();
|
||||
Disconnect();
|
||||
|
||||
// close socket
|
||||
for(unsigned int i = 0; i < std::size(m_NetClient); i++)
|
||||
m_NetClient[i].Close();
|
||||
|
||||
delete m_pEditor;
|
||||
m_pGraphics->Shutdown();
|
||||
|
||||
|
|
|
@ -2747,6 +2747,8 @@ int CServer::Run()
|
|||
free(Client.m_pPersistentData);
|
||||
}
|
||||
|
||||
m_NetServer.Close();
|
||||
|
||||
return ErrorShutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ bool CNetClient::Open(NETADDR BindAddr)
|
|||
|
||||
int CNetClient::Close()
|
||||
{
|
||||
// TODO: implement me
|
||||
return 0;
|
||||
if(!m_Socket)
|
||||
return 0;
|
||||
return net_udp_close(m_Socket);
|
||||
}
|
||||
|
||||
int CNetClient::Disconnect(const char *pReason)
|
||||
|
|
|
@ -96,8 +96,9 @@ int CNetServer::SetCallbacks(NETFUNC_NEWCLIENT pfnNewClient, NETFUNC_NEWCLIENT_N
|
|||
|
||||
int CNetServer::Close()
|
||||
{
|
||||
// TODO: implement me
|
||||
return 0;
|
||||
if(!m_Socket)
|
||||
return 0;
|
||||
return net_udp_close(m_Socket);
|
||||
}
|
||||
|
||||
int CNetServer::Drop(int ClientID, const char *pReason)
|
||||
|
|
Loading…
Reference in a new issue