.\" Man page generated from reStructuredText. . .TH "WSLAY_EVENT_QUEUE_MSG" "3" "Jun 20, 2020" "1.1.1" "wslay" .SH NAME wslay_event_queue_msg \- Queue a message for future transmission . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp #include .INDENT 0.0 .TP .B int wslay_event_queue_msg(wslay_event_context_ptr\fI\ ctx\fP, const struct wslay_event_msg\fI\ *arg\fP) .UNINDENT .INDENT 0.0 .TP .B int wslay_event_queue_msg_ex(wslay_event_context_ptr\fI\ ctx\fP, const struct wslay_event_msg\fI\ *arg\fP, uint8_t\fI\ rsv\fP) .UNINDENT .SH DESCRIPTION .sp \fI\%wslay_event_queue_msg()\fP and \fI\%wslay_event_queue_msg_ex()\fP queue message specified in \fIarg\fP\&. The \fIstruct wslay_event_msg\fP is defined as: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C struct wslay_event_msg { uint8_t opcode; const uint8_t *msg; size_t msg_length; }; .ft P .fi .UNINDENT .UNINDENT .sp The \fIopcode\fP member is opcode of the message. The \fImsg\fP member is the pointer to the message data. The \fImsg_length\fP member is the length of message data. .sp This function supports both control and non\-control messages and the given message is sent without fragmentation. If fragmentation is needed, use \fBwslay_event_queue_fragmented_msg()\fP function instead. .sp This function makes a copy of \fImsg\fP of length \fImsg_length\fP\&. .sp This function just queues a message and does not send it. \fBwslay_event_send()\fP function call sends these queued messages. .sp \fI\%wslay_event_queue_msg_ex()\fP additionally accepts \fIrsv\fP parameter, which is a reserved bits to send. To set reserved bits, use macro \fBWSLAY_RSV1_BIT\fP, \fBWSLAY_RSV2_BIT\fP, and \fBWSLAY_RSV3_BIT\fP\&. See \fBwslay_event_config_set_allowed_rsv_bits()\fP to see the allowed reserved bits to set. .SH RETURN VALUE .sp \fI\%wslay_event_queue_msg()\fP and \fI\%wslay_event_queue_msg_ex()\fP return 0 if it succeeds, or returns the following negative error codes: .INDENT 0.0 .TP \fBWSLAY_ERR_NO_MORE_MSG\fP Could not queue given message. The one of possible reason is that close control frame has been queued/sent and no further queueing message is not allowed. .TP \fBWSLAY_ERR_INVALID_ARGUMENT\fP The given message is invalid; or RSV1 is set for control frame; or bit is set in \fIrsv\fP which is not allowed (see \fBwslay_event_config_set_allowed_rsv_bits()\fP). .TP \fBWSLAY_ERR_NOMEM\fP Out of memory. .UNINDENT .SH SEE ALSO .sp \fBwslay_event_queue_fragmented_msg()\fP, \fBwslay_event_queue_fragmented_msg_ex()\fP, \fBwslay_event_queue_close()\fP .SH AUTHOR Tatsuhiro Tsujikawa .SH COPYRIGHT 2012, 2015, Tatsuhiro Tsujikawa .\" Generated by docutils manpage writer. .