You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libsxmp/man/sxmsg_reply.3

95 lines
2.9 KiB
Groff

.TH SXMSG_REPLY 3 "20 July 2015" "SXMP" "SXMP Library Manual"
.SH NAME
sxmsg_reply \- Reply to the message from the peer and wait while confirmation will be received.
.br
sxmsg_send_pp \- Reply to the message from the peer and wait while confirmation will be received in postponed message send mode.
.SH SYNOPSIS
.B #include <sxmp/sxmp.h>
.br
.sp
int sxmsg_reply(sxmsg_t *msg, const char *data, size_t datalen);
int sxmsg_reply_pp(sxmsg_t *msg, const char *data, size_t datalen);
.br
.sp
.SH DESCRIPTION
.B sxmsg_reply
Will reply to the message pointed by
.B msg
and awaits for the reply from the peer. It will attach the data pointed by
.B data
with length in bytes pointed by
.B datalen.
This message will be sent within context of the calling thread.
.br
.B sxmsg_reply_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
.SH RETURN VALUE
Dialog will be closed in all cases except the following error codes returns:
.sp
.B SXE_REPLYREQ
means other side waiting a reply for this message (i.e. dialog isn't closed).
.br
Other possible errors:
.br
.B SXE_SUCCESS
will returns if message was processed and dialog is closed.
.br
.B SXE_FAILED
pointed data is invalid.
.br
.B SXE_ENOMEM
not available memory for operation.
.br
.B SXE_BADPROTO
bad protocol.
.br
.B SXE_ENORPC
No RPC call exists i.e. message sent contains an invalid RPC function name.
.br
.B SXE_TOOLONG
Data os too long to be sent with one message.
.br
.B SXE_NOSUCHCHAN
Pointed channel doesn't exists
.br
.B SXE_ETIMEDOUT
Other side timedout with replying to your message.
.br
.B SXE_LINKBROKEN
Connection link is broken during a message send.
.br
.B SXE_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 sxlink_connect(3)
,
.BI sxchannel_open(3)
,
.BI sxmsg_rreply(3)
,
.BI sxmsg_return(3)
,
.BI sxmsg_send(3)
.SH COPYRIGHT
This software licensed under GNU LGPL v3. See COPYING for further details.
.br
(c) Askele Group 2013-2015 <http://askele.com>
.SH AUTHOR
Alexander Vdolainen (vdo@askele.com)