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
.SHDESCRIPTION
.Bsxmsg_reply
Will reply to the message pointed by
.Bmsg
and awaits for the reply from the peer. It will attach the data pointed by
.Bdata
with length in bytes pointed by
.Bdatalen.
This message will be sent within context of the calling thread.
.br
.Bsxmsg_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
.SHRETURNVALUE
Dialog will be closed in all cases except the following error codes returns:
.sp
.BSNE_REPLYREQ
means other side waiting a reply for this message (i.e. dialog isn't closed).
.br
Other possible errors:
.br
.BSNE_SUCCESS
will returns if message was processed and dialog is closed.
.br
.BSNE_FAILED
pointed data is invalid.
.br
.BSNE_ENOMEM
not available memory for operation.
.br
.BSNE_BADPROTO
bad protocol.
.br
.BSNE_ENORPC
No RPC call exists i.e. message sent contains an invalid RPC function name.
.br
.BSNE_TOOLONG
Data os too long to be sent with one message.
.br
.BSNE_NOSUCHCHAN
Pointed channel doesn't exists
.br
.BSNE_ETIMEDOUT
Other side timedout with replying to your message.
.br
.BSNE_LINKBROKEN
Connection link is broken during a message send.
.br
.BSNE_MMESSAGES
Limit for the active messages exceeded.
.br
.SHBUGS
Not known yet.
.SHEXAMPLE
None.
.SHAPPLICATIONUSAGE
None.
.SHRATIONALE
None.
.SHSEE_ALSO
.BIconnection_link(3)
,
.BIsxchannel_open(3)
,
.BIsxmsg_rreply(3)
,
.BIsxmsg_return(3)
,
.BIsxmsg_send(3)
.SHCOPYRIGHT
This is a proprietary software. See COPYING for further details.