* @brief Set a UNIX domain datagram socket up * * @param path The path to bind this socket to * @param flags Flags for `socket(2)` */
| 56 | * @param flags Flags for `socket(2)` |
| 57 | */ |
| 58 | void unix_dgram_client::setup(const char* path, int flags) { |
| 59 | if (sfd != -1) |
| 60 | throw socket_exception(__FILE__, __LINE__, |
| 61 | "unix_dgram_client::unix_dgram_client: Socket " |
| 62 | "has already been set up!", |
| 63 | false); |
| 64 | |
| 65 | sfd = create_unix_dgram_socket(path, flags); |
| 66 | |
| 67 | if (sfd < 0) |
| 68 | throw socket_exception(__FILE__, __LINE__, |
| 69 | "unix_dgram_client::unix_dgram_client: Could " |
| 70 | "not create unix dgram client socket!"); |
| 71 | |
| 72 | if (path) _path.assign(path); |
| 73 | |
| 74 | is_nonblocking = flags & SOCK_NONBLOCK; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * @brief Constructor with only `socket()` flags |
nothing calls this directly
no test coverage detected