| 258 | } |
| 259 | |
| 260 | inline TcpSocket Accept() { |
| 261 | SOCKET newfd = accept(sockfd_, NULL, NULL); |
| 262 | if (newfd == INVALID_SOCKET) { |
| 263 | Log::Fatal("Socket accept error, code: %d", GetLastError()); |
| 264 | } |
| 265 | return TcpSocket(newfd); |
| 266 | } |
| 267 | |
| 268 | inline int Send(const char *buf_, int len, int flag = 0) { |
| 269 | int cur_cnt = send(sockfd_, buf_, len, flag); |