| 51 | } |
| 52 | |
| 53 | int SetNonBlock(int sock_fd) { |
| 54 | int flags; |
| 55 | flags = fcntl(sock_fd, F_GETFL, 0); |
| 56 | flags |= O_NONBLOCK; |
| 57 | flags |= O_NDELAY; |
| 58 | int ret = fcntl(sock_fd, F_SETFL, flags); |
| 59 | return ret; |
| 60 | } |
| 61 | |
| 62 | int SetAddr(const char * ip_string, const unsigned short port, struct sockaddr_in & addr) { |
| 63 | bzero(&addr, sizeof(addr)); |
no outgoing calls
no test coverage detected