.\" Man page generated from reStructuredText. . .TH "WSLAY_EVENT_QUEUE_CLOSE" "3" "Jun 20, 2020" "1.1.1" "wslay" .SH NAME wslay_event_queue_close \- Queue a close control frame . .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_close(wslay_event_context_ptr\fI\ ctx\fP, uint16_t\fI\ status_code\fP, const uint8_t\fI\ *reason\fP, size_t\fI\ reason_length\fP) .UNINDENT .SH DESCRIPTION .sp \fI\%wslay_event_queue_close()\fP queues close control frame. This function is provided just for convenience. \fBwslay_event_queue_msg()\fP can queue a close control frame as well. \fIstatus_code\fP is the status code of close control frame. \fIreason\fP is the close reason encoded in UTF\-8. \fIreason_length\fP is the length of \fIreason\fP in bytes. \fIreason_length\fP must be less than 123 bytes. .sp If \fIstatus_code\fP is 0, \fIreason\fP and \fIreason_length\fP is not used and close control frame with zero\-length payload will be queued. .sp This function just queues a message and does not send it. \fBwslay_event_send()\fP function call sends these queued messages. .SH RETURN VALUE .sp \fI\%wslay_event_queue_close()\fP returns 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. .TP \fBWSLAY_ERR_NOMEM\fP Out of memory. .UNINDENT .SH SEE ALSO .sp \fBwslay_event_queue_msg()\fP, \fBwslay_event_queue_fragmented_msg()\fP .SH AUTHOR Tatsuhiro Tsujikawa .SH COPYRIGHT 2012, 2015, Tatsuhiro Tsujikawa .\" Generated by docutils manpage writer. .