X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink%2B%2B.h;fp=src%2Fmeshlink%2B%2B.h;h=dee2c7060d04bc352b59901f911fc7d8a78a7009;hb=a18da7ad8a0d9f28dabf97d15407ece748538888;hp=3666f67d827e789d724b431b4c76960ef24bda6a;hpb=57114d942004e8a34ff22aadc0c620a0aabbb423;p=meshlink diff --git a/src/meshlink++.h b/src/meshlink++.h index 3666f67d..dee2c706 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -650,6 +650,30 @@ public: meshlink_set_channel_poll_cb(handle, 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 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. + */ + void set_channel_sndbuf(channel *channel, size_t size) { + meshlink_set_channel_sndbuf(handle, channel, 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 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. + */ + void set_channel_rcvbuf(channel *channel, size_t size) { + meshlink_set_channel_rcvbuf(handle, channel, 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.