diff options
Diffstat (limited to 'src/libmdsclient/comm.h')
-rw-r--r-- | src/libmdsclient/comm.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libmdsclient/comm.h b/src/libmdsclient/comm.h index 94dcc7a..d26a2e2 100644 --- a/src/libmdsclient/comm.h +++ b/src/libmdsclient/comm.h @@ -19,6 +19,8 @@ #define MDS_LIBMDSCLIENT_COMM_H +#include "address.h" + #include <stdint.h> #include <stddef.h> #include <pthread.h> @@ -136,6 +138,25 @@ __attribute__((nonnull)) int libmds_connection_establish(libmds_connection_t* restrict this, const char** restrict display); /** + * Connect to the display server + * + * @param this The connection descriptor, must not be `NULL` + * @param address The address to connect to, must not be `NULL`, + * and must be the result of a successful call to + * `libmds_parse_display_adress` + * @return Zero on success, -1 on error. On error, `display` + * will point to `NULL` if MDS_DISPLAY is not defiend, + * otherwise, `errno` will have been set to describe + * the error. + * + * @throws Any error specified for socket(2) + * @throws Any error specified for connect(2), except EINTR + */ +__attribute__((nonnull)) +int libmds_connection_establish_address(libmds_connection_t* restrict this, + const libmds_display_address_t* restrict address); + +/** * Wrapper for `libmds_connection_send_unlocked` that locks * the mutex of the connection * |