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

Method Accept

phxcomm/net/net.cpp:59–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59int NetIO::Accept(const int &fd) {
60 struct sockaddr_in client_addr;
61 socklen_t length = sizeof(client_addr);
62
63 int conn = accept(fd, (struct sockaddr*) &client_addr, &length);
64 if (conn < 0) {
65 ColorLogError("accent fail fd %d", fd);
66 return SOCKET_FAIL;
67 }
68 return conn;
69}
70
71int NetIO::Connect(const char *ip, const uint32_t &port) {
72 int sock_cli = socket(AF_INET, SOCK_STREAM, 0);

Callers

nothing calls this directly

Calls 1

ColorLogErrorFunction · 0.85

Tested by

no test coverage detected