]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Skeleton design for opening a reliable channel
[meshlink] / src / meshlink.c
index 7ea3e440b0f941d773c06eba53a267b0199b7508..7d717e5ac564c7957f468635651b56e995f53583 100644 (file)
@@ -837,6 +837,8 @@ void meshlink_close(meshlink_handle_t *mesh) {
        exit_configuration(&mesh->config);
        event_loop_exit(&mesh->loop);
 
+       free(mesh);
+
 #ifdef HAVE_MINGW
        WSACleanup();
 #endif
@@ -1368,6 +1370,16 @@ void meshlink_blacklist(meshlink_handle_t *mesh, meshlink_node_t *node) {
 
 }
 
+meshlink_connection_t* meshlink_open_rchannel(meshlink_handle_t *mesh, meshlink_node_t *destination, uint16_t dport) {
+
+//TODO: check in mesh->socketsbitmap for a free descriptor and allocate a source port for this connection
+
+//TODO: register a callback for the data that will be received from this connection
+
+//TODO: return a description value that the user will use to write on this channel
+
+}
+
 static void __attribute__((constructor)) meshlink_init(void) {
        crypto_init();
 }