| 94 | return server_id; |
| 95 | } |
| 96 | static int lua_server_accept(int id,bool fail_on_timeout) |
| 97 | { |
| 98 | if(servers.count(id)==0) |
| 99 | { |
| 100 | throw std::runtime_error("Server not bound"); |
| 101 | } |
| 102 | server &cur_server=servers[id]; |
| 103 | CActiveSocket* sock=cur_server.socket->Accept(); |
| 104 | if(!sock) |
| 105 | { |
| 106 | handle_error(cur_server.socket->GetSocketError(),!fail_on_timeout); |
| 107 | return 0; |
| 108 | } |
| 109 | else |
| 110 | { |
| 111 | cur_server.last_client_id++; |
| 112 | cur_server.clients[cur_server.last_client_id]=sock; |
| 113 | return cur_server.last_client_id; |
| 114 | } |
| 115 | } |
| 116 | static void lua_client_close(int server_id,int client_id) |
| 117 | { |
| 118 | auto info=get_client(server_id,client_id); |
nothing calls this directly
no test coverage detected