MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_client_close

Function lua_client_close

plugins/luasocket.cpp:116–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 }
115}
116static void lua_client_close(int server_id,int client_id)
117{
118 auto info=get_client(server_id,client_id);
119
120 CActiveSocket *sock=info.first;
121 std::map<int,CActiveSocket*>* target=info.second;
122
123 target->erase(client_id);
124 CSimpleSocket::CSocketError err=CSimpleSocket::SocketSuccess;
125 if(!sock->Close())
126 err=sock->GetSocketError();
127 delete sock;
128 if(err!=CSimpleSocket::SocketSuccess)
129 {
130 throw std::runtime_error(CSimpleSocket::DescribeError(err));
131 }
132}
133static void lua_server_close(int server_id)
134{
135 if(servers.count(server_id)==0)

Callers

nothing calls this directly

Calls 3

get_clientFunction · 0.85
eraseMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected