| 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) |
| 68 | return; |
| 69 | if (err == CSimpleSocket::SocketTimedout && skip_timeout) |
| 70 | return; |
| 71 | if (err == CSimpleSocket::SocketEwouldblock && skip_timeout) |
| 72 | return; |
| 73 | throw std::runtime_error(CSimpleSocket::DescribeError(err)); |
| 74 | } |
| 75 | static int lua_socket_bind(std::string ip,int port) |
| 76 | { |
| 77 | static int server_id=0; |
no outgoing calls
no test coverage detected