| 48 | } |
| 49 | |
| 50 | int NetIO::SetSendTimeOut(const int &fd) { |
| 51 | struct timeval timeout = { 1, 0 }; |
| 52 | if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *) &timeout, sizeof(timeout))) { |
| 53 | ColorLogError("%s set fd %d timeout fail, error %s", __func__, fd, strerror(errno)); |
| 54 | return SOCKET_FAIL; |
| 55 | } |
| 56 | return OK; |
| 57 | } |
| 58 | |
| 59 | int NetIO::Accept(const int &fd) { |
| 60 | struct sockaddr_in client_addr; |
nothing calls this directly
no test coverage detected