* @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. */
| 120 | * @param path The path of the socket to connect this socket to. |
| 121 | */ |
| 122 | void 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 |
nothing calls this directly
no test coverage detected