aboutsummaryrefslogtreecommitdiff
path: root/client/libacron/include/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/libacron/include/net.h')
-rw-r--r--client/libacron/include/net.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/libacron/include/net.h b/client/libacron/include/net.h
index 5b10470..8fb33f8 100644
--- a/client/libacron/include/net.h
+++ b/client/libacron/include/net.h
@@ -20,10 +20,29 @@ typedef struct ac_connection_parameters {
char *url;
} ac_connection_parameters_t;
+/**
+ * Connect to the server.
+ * @param parameters Connection parameters. Untouched.
+ * @param out Output connection reference if succeeds. Not-NULL.
+ * @return AC_E_OK or an error code. When failed, *out will be untouched.
+ * MT-Safe
+ */
int ac_connect(ac_connection_parameters_t parameters, void **out);
+/**
+ * Disconnect the connection.
+ * @param connection A non-NULL and connected connection passed as-is from ac_connect.
+ * @return AC_E_OK or an error code. When failed, connection is undefined. When succeeds, connection is freed and invalid.
+ * MT-Unsafe
+ */
int ac_disconnect(void *connection);
+/**
+ * Blocks the current thread until a new response or event arrives.
+ * @param connection A non-NULL and connected connection passed as-is from ac_connect.
+ * @param response Output response of either an event or a response. May be NULL even if it succeeds.
+ * @return AC_E_OK or an error code. When failed, *response is NULL.
+ */
int ac_receive(void *connection, ac_obj_t **response);
#endif /* LIBAC_NET_H */