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

Method connect

C++/unixclientdgram.cpp:122–136  ·  view source on GitHub ↗

* @brief Connect a UNIX datagram socket * * This function connects a datagram socket; `connect(2)` says the following * about this: * * > If the socket sockfd is of type SOCK_DGRAM then addr is the address to * which datagrams are sent by default, and the only address from which * datagrams are received. * * @param path The path of the socket to connect this socket to. */

Source from the content-addressed store, hash-verified

120 * @param path The path of the socket to connect this socket to.
121 */
122void unix_dgram_client::connect(const char* path) {
123 if (sfd == -1)
124 throw socket_exception(
125 __FILE__, __LINE__,
126 "unix_dgram_client::connect() - Socket has already been closed!",
127 false);
128 if (connect_unix_dgram_socket(sfd, path) < 0)
129 throw socket_exception(
130 __FILE__, __LINE__,
131 "unix_dgram_client::connect: Could not connect dgram socket!");
132
133 _path.assign(path);
134
135 connected = true;
136}
137
138/**
139 * @brief Connect a UNIX datagram socket

Callers

nothing calls this directly

Calls 2

socket_exceptionClass · 0.85

Tested by

no test coverage detected