MCPcopy Create free account
hub / github.com/dermesser/libsocket / connect

Method connect

C++/unixclientstream.cpp:89–107  ·  view source on GitHub ↗

* @brief Connect socket * * Connects a client stream socket. * * @param path The server socket's path * @param socket_flags Flags for `socket(2)` (Do I repeat myself?) */

Source from the content-addressed store, hash-verified

87 * @param socket_flags Flags for `socket(2)` (Do I repeat myself?)
88 */
89void unix_stream_client::connect(const char* path, int socket_flags) {
90 if (sfd != -1)
91 throw socket_exception(
92 __FILE__, __LINE__,
93 "unix_stream_client::connect: Already connected!", false);
94
95 sfd = create_unix_stream_socket(path, socket_flags);
96
97 _path.assign(path);
98
99 if (sfd < 0)
100 throw socket_exception(__FILE__, __LINE__,
101 "unix_stream_client::unix_stream_client: Could "
102 "not create and connect UNIX socket!");
103
104 // New file descriptor, therefore reset shutdown flags
105 shut_rd = false;
106 shut_wr = false;
107}
108
109/**
110 * @brief Connect socket

Callers

nothing calls this directly

Calls 2

socket_exceptionClass · 0.85

Tested by

no test coverage detected