libsxmp/man/sxmsg_rreply.3

60 lines
1.7 KiB
Groff
Raw Normal View History

2015-10-27 00:20:44 +02:00
.TH SXMSG_RREPLY 3 "20 July 2015" "SXMP" "SXMP Library Manual"
2015-07-21 04:38:05 +03:00
.SH NAME
sxmsg_rreply \- Function used to send a rapid reply without confirmation
.SH SYNOPSIS
2015-10-27 00:20:44 +02:00
.B #include <sxmp/sxmp.h>
2015-07-26 06:08:01 +03:00
.br
2015-10-27 00:20:44 +02:00
.B #include <sxmp/limits.h>
2015-07-21 04:38:05 +03:00
.sp
2015-07-23 14:53:47 +03:00
int sxmsg_rreply(sxmsg_t
.BI *msg
, size_t
.BI datalen
);
2015-07-21 04:38:05 +03:00
.br
.sp
.SH DESCRIPTION
.B sxmsg_rreply
2015-07-23 14:53:47 +03:00
Will reply rapidly to the message using already allocated buffer, which must be
retrieved via
.B sxmsg_rapidbuf().
This function will write desired message as soon
as possible. It will not wait any write or delivery confirmation. It will close
message dialog if message is valid.
2015-07-21 04:57:39 +03:00
.br
.SH RETURN VALUE
2015-07-23 14:53:47 +03:00
Upon successful completion, the function shall rapidly send a message reply and close
the message dialog returning
2015-11-13 14:23:05 +02:00
.B SXE_SUCCESS
2015-07-23 14:53:47 +03:00
Othrewise other error code will be returned.
.SH ERRORS
2015-11-13 14:23:05 +02:00
.B SXE_FAILED
2015-07-21 04:57:39 +03:00
returns if message has invalid index, channel or message pointer is NULL.
.br
2015-11-13 14:23:05 +02:00
.B SXE_ESSL
returns if write was failed i.e. link was broken, or SSL error occurs.
2015-07-21 04:57:39 +03:00
.br
.B SNE_SUCCESS
returns on success.
.br
.SH BUGS
Not known yet.
.SH EXAMPLE
.B Reply rapidly from the RPC function call.
.RS
.nf
.if t .ft CW
char *buf = sxmsg_rapidbuf(msg);
2015-07-26 06:08:01 +03:00
int ln = snprintf(buf, MAX_RBBUF_LEN, "(is-done)");
2015-07-21 04:57:39 +03:00
return sxmsg_rreply(msg, str, ln);
2015-07-23 14:53:47 +03:00
.SH APPLICATION USAGE
2015-08-04 19:23:24 +03:00
This function will be useful in RPC functions required to reply ASAP i.e. for getting some data. If RPC function takes a lot of time it's better to use other functions and/or postponed message processing.
2015-07-23 14:53:47 +03:00
.SH RATIONALE
2015-10-27 00:20:44 +02:00
Use for lightweight RPC functions, this method can be used only in RPC call i.e. within SXMP thread context.
2015-07-23 14:53:47 +03:00
.SH COPYRIGHT
2015-12-29 22:42:52 +02:00
This software licensed under GNU LGPL v3. See COPYING for further details.
2015-07-23 14:53:47 +03:00
.br
(c) Askele Group 2013-2015 <http://askele.com>
.SH AUTHOR
Alexander Vdolainen (vdo@askele.com)