.\" Man page generated from reStructuredText. . .TH "WSLAY_EVENT_QUEUE_FRAGMENTED_MSG" "3" "Jun 20, 2020" "1.1.1" "wslay" .SH NAME wslay_event_queue_fragmented_msg \- Queue a fragmented 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_fragmented_msg(wslay_event_context_ptr\fI\ ctx\fP, const struct wslay_event_fragmented_msg\fI\ *arg\fP) .UNINDENT .INDENT 0.0 .TP .B int wslay_event_queue_fragmented_msg_ex(wslay_event_context_ptr\fI\ ctx\fP, const struct wslay_event_fragmented_msg\fI\ *arg\fP, uint8_t\fI\ rsv\fP) .UNINDENT .SH DESCRIPTION .sp \fI\%wslay_event_queue_fragmented_msg()\fP and \fI\%wslay_event_queue_fragmented_msg_ex()\fP queue a fragmented message specified in \fIarg\fP\&. The \fIstruct wslay_event_fragmented_msg\fP is defined as: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C union wslay_event_msg_source { int fd; void *data; }; struct wslay_event_fragmented_msg { uint8_t opcode; union wslay_event_msg_source source; wslay_event_fragmented_msg_callback read_callback; }; .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B typedef ssize_t (*wslay_event_fragmented_msg_callback)(wslay_event_context_ptr\fI\ ctx\fP, uint8_t\fI\ *buf\fP, size_t\fI\ len\fP, const union wslay_event_msg_source\fI\ *source\fP, int\fI\ *eof\fP, void\fI\ *user_data\fP) .UNINDENT .sp The \fIopcode\fP member is the opcode of the message. The \fIsource\fP member is an union and normally it contains a "source" to generate message data. The \fIread_callback\fP is a callback function called by \fBwslay_event_send()\fP to read message data from \fIsource\fP\&. The implementation of \fI\%wslay_event_fragmented_msg_callback\fP must store at most \fIlen\fP bytes of data to \fIbuf\fP and return the number of stored bytes. If all data is read (i.e., EOF), set \fI*eof\fP to 1. If no data can be generated at the moment, return 0. If there is an error, return \-1 and set error code \fBWSLAY_ERR_CALLBACK_FAILURE\fP using \fBwslay_event_set_error()\fP\&. .sp This function supports non\-control messages only. For control frames, use \fBwslay_event_queue_msg()\fP or \fBwslay_event_queue_close()\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_fragmented_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_fragmented_msg()\fP and \fI\%wslay_event_queue_fragmented_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 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_msg()\fP, \fBwslay_event_queue_msg_ex()\fP, \fBwslay_event_queue_close()\fP .SH AUTHOR Tatsuhiro Tsujikawa .SH COPYRIGHT 2012, 2015, Tatsuhiro Tsujikawa .\" Generated by docutils manpage writer. .