From d8ce55fe7179a1beea8d5bf2a58e7f34fb07422e Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Wed, 5 Aug 2015 02:22:58 +0300 Subject: [PATCH] man: added sxmsg_send* and sxmsg_clean manpages; --- man/Makefile.am | 2 +- man/sxmsg_clean.3 | 1 + man/sxmsg_send.3 | 103 ++++++++++++++++++++++++++++++++++++++++++++ man/sxmsg_send_pp.3 | 1 + 4 files changed, 106 insertions(+), 1 deletion(-) create mode 120000 man/sxmsg_clean.3 create mode 100644 man/sxmsg_send.3 create mode 120000 man/sxmsg_send_pp.3 diff --git a/man/Makefile.am b/man/Makefile.am index 66d4d9e..226a414 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -3,4 +3,4 @@ man_MANS = sxmsg_rreply.3 connections_create.3 connections_init.3 connections_de connections_set_ondestroy.3 connections_set_onpulse.3 connections_set_sslvalidate.3 \ connections_set_authcheck.3 connections_set_rpcvalidator.3 connections_set_channelcall.3 \ connection_master_link.3 connection_link.3 connection_close.3 sxchannel_open.3 \ - sxchannel_close.3 + sxchannel_close.3 sxmsg_send.3 sxmsg_send_pp.3 sxmsg_clean.3 diff --git a/man/sxmsg_clean.3 b/man/sxmsg_clean.3 new file mode 120000 index 0000000..1de9cc5 --- /dev/null +++ b/man/sxmsg_clean.3 @@ -0,0 +1 @@ +sxmsg_send.3 \ No newline at end of file diff --git a/man/sxmsg_send.3 b/man/sxmsg_send.3 new file mode 100644 index 0000000..5dfb0f7 --- /dev/null +++ b/man/sxmsg_send.3 @@ -0,0 +1,103 @@ +.TH SXMSG_SEND 3 "20 July 2015" "SNTLLv2" "SNTL Library Manual" +.SH NAME +sxmsg_send \- Create and send a message within called thread context. +.br +sxmsg_send_pp \- Create and send a message in postponed mode. +.SH SYNOPSIS +.B #include +.br +.sp +int sxmsg_send(chnl_t *channel, const char *data, size_t datalen, sxmsg_t **msg); + +int sxmsg_send_pp(chnl_t *channel, const char *data, size_t datalen, sxmsg_t **msg); + +void sxmsg_clean(sxmsg_t *msg); +.br +.sp +.SH DESCRIPTION +.B sxmsg_send +Will create and send message using channel pointed by +.B channel +with data pointed by +.B data +with length pointed in bytes using +.B datalen. +If message dialog will continue pointer to the message with reply will be pushed to +.B msg. +This message will be sent within context of the calling thread. +.br +.B sxmsg_send_pp +Will do exactly the same, but message sending will be postponed and sent by one of the thread serving the underlying connection link. +.br +Both calls will cause a sleep of the calling thread until reply or error will be returned. I.e. this call is blocking one. Also, message is actually atom of the dialog, that means one side sending a first message creates dialog, other side may or may not close this dialog with error code (actual a message without data) or with some data, you should track the message return code to correctly close dialogs. +.br +If dialogs will be not finished correctly the limit of active messages will be exceeded and you will be not able to create a new dialog while message poll is full with opened dialogs. It's a good practice to avoid long dialog queues in critical operations or operations required to send a lot of data, since each message can take a lot of time (SSL time, network time). +.br +.B sxmsg_clean +will clean up the data used for closed dialog message, it should be used in case of rapid reply to avoid memory leaks. +.SH RETURN VALUE +Dialog will be closed in all cases except the following error codes returns: +.sp +.B SNE_REPLYREQ +means other side waiting a reply for this message (i.e. dialog isn't closed). +.br +In other cases message will not set except +.B SNE_RAPIDMSG +error code, in this case to avoid memory leaks +.B sxmsg_clean +must be called after data is processed. In other cases a different and specific error code might be returned, but usual cases listed below: +.br +.B SNE_SUCCESS +will returns if message was processed and dialog is closed. +.br +.B SNE_FAILED +pointed data is invalid. +.br +.B SNE_ENOMEM +not available memory for operation. +.br +.B SNE_BADPROTO +bad protocol. +.br +.B SNE_ENORPC +No RPC call exists i.e. message sent contains an invalid RPC function name. +.br +.B SNE_TOOLONG +Data os too long to be sent with one message. +.br +.B SNE_NOSUCHCHAN +Pointed channel doesn't exists +.br +.B SNE_ETIMEDOUT +Other side timedout with replying to your message. +.br +.B SNE_LINKBROKEN +Connection link is broken during a message send. +.br +.B SNE_MMESSAGES +Limit for the active messages exceeded. +.br +.SH BUGS +Not known yet. +.SH EXAMPLE +None. +.SH APPLICATION USAGE +None. +.SH RATIONALE +None. +.SH SEE_ALSO +.BI connection_link(3) +, +.BI sxchannel_open(3) +, +.BI sxmsg_rreply(3) +, +.BI sxmsg_return(3) +, +.BI sxmsg_reply +.SH COPYRIGHT +This is a proprietary software. See COPYING for further details. +.br +(c) Askele Group 2013-2015 +.SH AUTHOR +Alexander Vdolainen (vdo@askele.com) diff --git a/man/sxmsg_send_pp.3 b/man/sxmsg_send_pp.3 new file mode 120000 index 0000000..1de9cc5 --- /dev/null +++ b/man/sxmsg_send_pp.3 @@ -0,0 +1 @@ +sxmsg_send.3 \ No newline at end of file