MCPcopy Create free account
hub / github.com/MariaDB/server / socket_connect

Function socket_connect

plugin/handler_socket/libhsclient/socket.cpp:122–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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