Man page - wslay_event_queue_msg(3)
Packages contas this manual
- wslay_event_get_status_code_sent(3)
- wslay_event_get_read_enabled(3)
- wslay_event_config_set_max_recv_msg_length(3)
- wslay_event_set_error(3)
- wslay_event_want_read(3)
- wslay_event_recv(3)
- wslay_event_context_client_init(3)
- wslay_event_context_server_init(3)
- wslay_event_shutdown_write(3)
- wslay_event_want_write(3)
- wslay_event_queue_close(3)
- wslay_event_send(3)
- wslay_event_queue_fragmented_msg_ex(3)
- wslay_event_queue_msg_ex(3)
- wslay_event_get_queued_msg_length(3)
- wslay_event_shutdown_read(3)
- wslay_event_get_status_code_received(3)
- wslay_event_queue_msg(3)
- wslay_event_get_close_sent(3)
- wslay_event_get_close_received(3)
- wslay_event_config_set_callbacks(3)
- wslay_event_config_set_allowed_rsv_bits(3)
- wslay_event_context_free(3)
- wslay_event_config_set_no_buffering(3)
- wslay_event_get_queued_msg_count(3)
- wslay_event_queue_fragmented_msg(3)
- wslay_event_get_write_enabled(3)
apt-get install libwslay-doc
Manual
| WSLAY_EVENT_QUEUE_MSG(3) | wslay | WSLAY_EVENT_QUEUE_MSG(3) |
NAME
wslay_event_queue_msg - Queue a message for future transmission
SYNOPSIS
#include <wslay/wslay.h>
DESCRIPTION
wslay_event_queue_msg() and wslay_event_queue_msg_ex() queue message specified in arg. The struct wslay_event_msg is defined as:
struct wslay_event_msg {
uint8_t opcode;
const uint8_t *msg;
size_t msg_length;
};
The opcode member is opcode of the message. The msg member is the pointer to the message data. The msg_length member is the length of message data.
This function supports both control and non-control messages and the given message is sent without fragmentation. If fragmentation is needed, use wslay_event_queue_fragmented_msg() function instead.
This function makes a copy of msg of length msg_length.
This function just queues a message and does not send it. wslay_event_send() function call sends these queued messages.
wslay_event_queue_msg_ex() additionally accepts rsv parameter, which is a reserved bits to send. To set reserved bits, use macro WSLAY_RSV1_BIT, WSLAY_RSV2_BIT, and WSLAY_RSV3_BIT. See wslay_event_config_set_allowed_rsv_bits() to see the allowed reserved bits to set.
RETURN VALUE
wslay_event_queue_msg() and wslay_event_queue_msg_ex() return 0 if it succeeds, or returns the following negative error codes:
- WSLAY_ERR_NO_MORE_MSG
- 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.
- WSLAY_ERR_INVALID_ARGUMENT
- The given message is invalid; or RSV1 is set for control frame; or bit is set in rsv which is not allowed (see wslay_event_config_set_allowed_rsv_bits()).
- WSLAY_ERR_NOMEM
- Out of memory.
SEE ALSO
wslay_event_queue_fragmented_msg(), wslay_event_queue_fragmented_msg_ex(), wslay_event_queue_close()
AUTHOR
Tatsuhiro Tsujikawa
COPYRIGHT
2023, 2015, Tatsuhiro Tsujikawa
| August 3, 2023 | @PACKAGE_VERSION@ |