X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fmeshlink%2B%2B.h;h=f5921363e0dffa550a5a38065bc8eaafc703829f;hp=e39ef81cde7bc4fd34c7de747da5ec5d46fc2a5c;hb=72a9c7ede43a275eba374a3de1ee880b93c2f328;hpb=3e671a6a114a31ca1e6bbd0d13921637ee7ce1b5 diff --git a/src/meshlink++.h b/src/meshlink++.h index e39ef81c..f5921363 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -708,6 +708,18 @@ public: meshlink_set_channel_rcvbuf(handle, channel, size); } + /// Set the connection timeout used for channels to the given node. + /** This sets the timeout after which unresponsive channels will be reported as closed. + * The timeout is set for all current and future channels to the given node. + * + * @param channel A handle for the channel. + * @param timeout The timeout in seconds after which unresponsive channels will be reported as closed. + * The default is 60 seconds. + */ + void set_node_channel_timeout(node *node, int timeout) { + meshlink_set_node_channel_timeout(handle, node, timeout); + } + /// 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.