.TH SXLINK_MASTER_ACCEPT 3 "15 March 2016" "SXMP" "SXMP Library Manual" .SH NAME sxlink_master_accept \- Create a new link on already accept TCP connection on the master side. .br sxlink_connect \- Create link to the master. .br sxlink_connect_at \- Create link to the master and assign private data. .br sxlink_close \- Close link. .SH SYNOPSIS .B #include .sp sxlink_t *sxlink_master_accept(sxhub_t *hub, int sck, struct in_addr *addr); sxlink_t *sxlink_connect(sxhub_t *hub, const char *host, int port, const char *SSL_cert, const char *login, const char *passwd); sxlink_t *sxlink_connect_at(sxhub_t *hub, const char *host, int port, const char *SSL_cert, const char *login, const char *passwd, const void *priv); int sxlink_close(sxlink_t *co); .br .sp .SH DESCRIPTION .B sxlink_master_accept will create a new link within .B hub hub with already accepted socket fd .B sck and set ip address of this connection pointed by .B addr. If .B addr is NULL, peer address will not set. .br .B sxlink_connect will create a new link to the master side using .B hub hub to the host pointed via hostname or ip address in nul terminated string .B host running on port number .B port and send a X.509 certificate located on pathname pointed by .B SSL_cert trying to authorizated with username pointed by .B login and password pointed by .B passwd .br .B sxlink_connect_at will do the same as .B sxlink_connect but also will assign a private data pointed by .B priv to be used by application implementation. .br .B sxlink_close will close link pointed by .B co destroying all allocated structures, including connection link itself. .br .SH RETURN VALUE Upon successful completion, the functions .B sxlink_master_accept and .B sxlink_connect will return a valid pointer to the newly created link. Otherwise NULL will be returned and .B errno will be set with appropriate error. .B sxlink_close will return .B SXE_SUCCESS on successful case, otherwise it will return an error described below. .SH ERRORS .B SXE_FAILED will be returned in case of bad params given. .br .B SXE_ENOMEM will be returned if there are no memory available. .br .B SXE_BADPROTO will be returned if other side has an invalid protocol. .B SXE_EPERM will be returned if permission was denied. .br .B SXE_LINKERROR or .B SXE_LINKBROKEN will be returned if connection link is broken i.e. SSL read or write was failed due to the broken TCP connection. .br .SH BUGS Not known yet. .SH EXAMPLE None. .SH APPLICATION USAGE None. .SH RATIONALE Using connection_link on master side with initialized connections set for master functionality will cause memory leaks, use different connections set structure if you need this functionality on the masters side. .SH SEE ALSO .BI sxhub_setsslserts(3) , .BI sxhub_create(3) , .BI sxhub_destroy(3) , .BI sxmp_init(3) .SH COPYRIGHT This software licensed under GNU LGPL v3. See COPYING for further details. .br (c) Askele Group 2013-2015 , (c) libsxmp dev team 2016 .SH AUTHOR Alexander Vdolainen (avdolainen@zoho.com)