Added zts_set_service_port()

This commit is contained in:
Joseph Henry
2018-02-07 17:35:27 -08:00
parent b0ac457ff1
commit 8df91ae1c8
4 changed files with 47 additions and 8 deletions

View File

@@ -75,6 +75,18 @@
extern "C" {
#endif
/**
* @brief (optional) Sets the port for the background libzt service. If this function is called
* with a port number between 1-65535 it will attempt to bind to that port. If it is called with
* a port number of 0 it will attempt to randomly search for an available port. If this function
* is never called, the service will try to bind on LIBZT_DEFAULT_PORT which is 9994.
*
* @usage Should be called at the beginning of your application before `zts_startjoin()`
* @param portno Port number
* @return 0 if successful; or -1 if failed
*/
ZT_SOCKET_API int ZTCALL zts_set_service_port(int portno);
/**
* @brief Starts libzt
*