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_rreply.3

60 lines
1.8 KiB
Groff

.TH SXMSG_RREPLY 3 "20 July 2015" "SXMP" "SXMP Library Manual"
.SH NAME
sxmsg_rreply \- Function used to send a rapid reply without confirmation
.SH SYNOPSIS
.B #include <sxmp/sxmp.h>
.br
.B #include <sxmp/limits.h>
.sp
int sxmsg_rreply(sxmsg_t
.BI *msg
, size_t
.BI datalen
);
.br
.sp
.SH DESCRIPTION
.B sxmsg_rreply
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.
.br
.SH RETURN VALUE
Upon successful completion, the function shall rapidly send a message reply and close
the message dialog returning
.B SXE_SUCCESS
Othrewise other error code will be returned.
.SH ERRORS
.B SXE_FAILED
returns if message has invalid index, channel or message pointer is NULL.
.br
.B SXE_ESSL
returns if write was failed i.e. link was broken, or SSL error occurs.
.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);
int ln = snprintf(buf, MAX_RBBUF_LEN, "(is-done)");
return sxmsg_rreply(msg, str, ln);
.SH APPLICATION USAGE
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.
.SH RATIONALE
Use for lightweight RPC functions, this method can be used only in RPC call i.e. within SXMP thread context.
.SH COPYRIGHT
This software licensed under GNU LGPL v2.1. See COPYING for further details.
.br
(c) Askele Group 2013-2015 <http://askele.com>
.SH AUTHOR
Alexander Vdolainen (vdo@askele.com)