X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink%2B%2B.h;h=64673f58cb42dc119ef9eea30e6d2d67826a9b8b;hb=9919d6688b2c79a0da93e3f39eeea2b58e923a1e;hp=e39ef81cde7bc4fd34c7de747da5ec5d46fc2a5c;hpb=4216a7e7a1897c0e34ce82e7c2c4cc82070c7b10;p=meshlink diff --git a/src/meshlink++.h b/src/meshlink++.h index e39ef81c..64673f58 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. @@ -720,6 +732,7 @@ public: * @param cb A pointer to the function which will be called when the remote node sends data to the local node. * @param data A pointer to a buffer containing data to already queue for sending. * @param len The length of the data. + * If len is 0, the data pointer is copied into the channel's priv member. * @param flags A bitwise-or'd combination of flags that set the semantics for this channel. * * @return A handle for the channel, or NULL in case of an error. @@ -744,6 +757,7 @@ public: * @param port The port number the peer wishes to connect to. * @param data A pointer to a buffer containing data to already queue for sending. * @param len The length of the data. + * If len is 0, the data pointer is copied into the channel's priv member. * @param flags A bitwise-or'd combination of flags that set the semantics for this channel. * * @return A handle for the channel, or NULL in case of an error.