| 43 | delete socket; |
| 44 | } |
| 45 | std::pair<CActiveSocket*,clients_map*> get_client(int server_id,int client_id) |
| 46 | { |
| 47 | std::map<int,CActiveSocket*>* target=&clients; |
| 48 | if(server_id>0) |
| 49 | { |
| 50 | if(servers.count(server_id)==0) |
| 51 | { |
| 52 | throw std::runtime_error("Server with this id does not exist"); |
| 53 | } |
| 54 | server &cur_server=servers[server_id]; |
| 55 | target=&cur_server.clients; |
| 56 | } |
| 57 | |
| 58 | if(target->count(client_id)==0) |
| 59 | { |
| 60 | throw std::runtime_error("Client does with this id not exist"); |
| 61 | } |
| 62 | CActiveSocket *sock=(*target)[client_id]; |
| 63 | return std::make_pair(sock,target); |
| 64 | } |
| 65 | void handle_error(CSimpleSocket::CSocketError err,bool skip_timeout=true) |
| 66 | { |
| 67 | if (err == CSimpleSocket::SocketSuccess) |
no test coverage detected