MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / socket_connect

Function socket_connect

libhsclient/socket.cpp:123–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123int
124socket_connect(auto_file& fd, const socket_args& args, std::string& err_r)
125{
126 int r = 0;
127 if ((r = socket_open(fd, args, err_r)) != 0) {
128 return r;
129 }
130 if (connect(fd.get(), reinterpret_cast<const sockaddr *>(&args.addr),
131 args.addrlen) != 0) {
132 if (!args.nonblocking || errno != EINPROGRESS) {
133 return errno_string("connect", errno, err_r);
134 }
135 }
136 return 0;
137}
138
139int
140socket_bind(auto_file& fd, const socket_args& args, std::string& err_r)

Callers 7

test_1Method · 0.85
test_6Method · 0.85
test_7Method · 0.85
test_10Method · 0.85
test_21Method · 0.85
hstcpcliMethod · 0.85
reconnectMethod · 0.85

Calls 3

socket_openFunction · 0.85
errno_stringFunction · 0.85
getMethod · 0.45

Tested by 5

test_1Method · 0.68
test_6Method · 0.68
test_7Method · 0.68
test_10Method · 0.68
test_21Method · 0.68