X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink.h;h=e043d8d28f3a402dc52e7ed4f9ffc554a8ee1c60;hb=b0319f8d358c476e29d3c6daeef1cda616cfd447;hp=00aa19b26849413b664d3fc2c0331ab3730399ef;hpb=4216a7e7a1897c0e34ce82e7c2c4cc82070c7b10;p=meshlink diff --git a/src/meshlink.h b/src/meshlink.h index 00aa19b2..e043d8d2 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -1171,6 +1171,7 @@ extern void meshlink_set_channel_rcvbuf(struct meshlink_handle *mesh, struct mes * The pointer may be NULL, in which case incoming data is ignored. * @param data A pointer to a buffer containing data to already queue for sending, or NULL if there is no data to send. * After meshlink_send() returns, the application is free to overwrite or free this buffer. + * If len is 0, the data pointer is copied into the channel's priv member. * @param len The length of the data, or 0 if there is no data to send. * @param flags A bitwise-or'd combination of flags that set the semantics for this channel. * @@ -1199,6 +1200,7 @@ extern struct meshlink_channel *meshlink_channel_open_ex(struct meshlink_handle * @param data A pointer to a buffer containing data to already queue for sending, or NULL if there is no data to send. * After meshlink_send() returns, the application is free to overwrite or free this buffer. * @param len The length of the data, or 0 if there is no data to send. + * If len is 0, the data pointer is copied into the channel's priv member. * * @return A handle for the channel, or NULL in case of an error. * The handle is valid until meshlink_channel_close() is called. @@ -1380,6 +1382,18 @@ extern size_t meshlink_channel_get_sendq(struct meshlink_handle *mesh, struct me */ extern size_t meshlink_channel_get_recvq(struct meshlink_handle *mesh, struct meshlink_channel *channel); +/// 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. + * + * \memberof meshlink_node + * @param mesh A handle which represents an instance of MeshLink. + * @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. + */ +extern void meshlink_set_node_channel_timeout(struct meshlink_handle *mesh, struct meshlink_node *node, int timeout); + /// Hint that a hostname may be found at an address /** This function indicates to meshlink that the given hostname is likely found * at the given IP address and port.