MCPcopy Create free account
hub / github.com/Tencent/phxsql / SetSendTimeOut

Method SetSendTimeOut

phxcomm/net/net.cpp:50–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50int 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
59int NetIO::Accept(const int &fd) {
60 struct sockaddr_in client_addr;

Callers

nothing calls this directly

Calls 1

ColorLogErrorFunction · 0.85

Tested by

no test coverage detected