]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.h
Allow the channel send and receive buffer size to be changed.
[meshlink] / src / meshlink.h
index 31583e510050589506e493a6afff798aa3eda015..075d5f16fee33618fbfa130f3862841f826605fd 100644 (file)
@@ -1035,6 +1035,28 @@ extern void meshlink_set_channel_receive_cb(meshlink_handle_t *mesh, meshlink_ch
  */
 extern void meshlink_set_channel_poll_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, meshlink_channel_poll_cb_t cb);
 
+/// Set the send buffer size of a channel.
+/** This function sets the desired size of the send buffer.
+ *  The default size is 128 kB.
+ *
+ *  @param mesh      A handle which represents an instance of MeshLink.
+ *  @param channel   A handle for the channel.
+ *  @param size      The desired size for the send buffer.
+ *                   If a NULL pointer is given, the callback will be disabled.
+ */
+extern void meshlink_set_channel_sndbuf(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_t size);
+
+/// Set the receive buffer size of a channel.
+/** This function sets the desired size of the receive buffer.
+ *  The default size is 128 kB.
+ *
+ *  @param mesh      A handle which represents an instance of MeshLink.
+ *  @param channel   A handle for the channel.
+ *  @param size      The desired size for the send buffer.
+ *                   If a NULL pointer is given, the callback will be disabled.
+ */
+extern void meshlink_set_channel_rcvbuf(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_t size);
+
 /// Open a reliable stream channel to another node.
 /** This function is called whenever a remote node wants to open a channel to the local node.
  *  The application then has to decide whether to accept or reject this channel.