WSLAY_EVENT_QUEUE_MSG_EX(3)
π WSLAY_EVENT_QUEUE_MSG_EX(3) π
okay bestie, welcome to the wslay corner of the manual, section 3 π¦ β this is the one where we queue up a message and let it sit there, waiting for its moment. main character energy, honestly.
β¨ NAME β¨
wslay_event_queue_msg_ex β queue a message for future transmission π
πΈ SYNOPSIS πΈ
#include <wslay/wslay.h>
int wslay_event_queue_msg(wslay_event_context_ptr ctx, const struct
wslay_event_msg *arg)
int wslay_event_queue_msg_ex(wslay_event_context_ptr ctx, const struct
wslay_event_msg *arg, uint8_t rsv)
π DESCRIPTION π
So, wslay_event_queue_msg() and wslay_event_queue_msg_ex() queue the message you specified in arg. no cap, that's the whole job. the struct wslay_event_msg is defined like this, and yes you're gonna wanna screenshot it:
struct wslay_event_msg {
uint8_t opcode;
const uint8_t *msg;
size_t msg_length;
};
- the
opcodemember is the opcode of the message π - the
msgmember is the pointer to the message data π - the
msg_lengthmember is the length of message data π
this function supports both control and non-control messages, and the given message is sent without fragmentation. if you need fragmentation, use wslay_event_queue_fragmented_msg() instead β that's its whole thing, let it cook. π₯
also, this function makes a copy of msg of length msg_length. so yeah, it's taking a lil photocopy, you're free to do whatever with your original after. π«Ά
and listen β this function just queues a message, it does not send it. it's giving "waiting in the group chat drafts" energy. the wslay_event_send() function call is what actually sends these queued messages. periodt. π
now, wslay_event_queue_msg_ex() additionally accepts the rsv parameter, which is a reserved bits to send. to set reserved bits, use the macro WSLAY_RSV1_BIT, WSLAY_RSV2_BIT, and WSLAY_RSV3_BIT. and if you wanna know which reserved bits you're even allowed to set, go check wslay_event_config_set_allowed_rsv_bits() β that's the vibe check right there. β
π RETURN VALUE π
both wslay_event_queue_msg() and wslay_event_queue_msg_ex() return 0 if it succeeds π, or they return the following negative error codes when it's not slaying:
WSLAY_ERR_NO_MORE_MSGβ could not queue given message. one of the possible reasons is that a close control frame has been queued/sent and no further queueing message is not allowed. like, the door is CLOSED, bestie. πWSLAY_ERR_INVALID_ARGUMENTβ the given message is invalid; or RSV1 is set for control frame; or a bit is set inrsvwhich is not allowed (seewslay_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 β legend behavior, honestly. πβοΈ
π COPYRIGHT π
2024, 2015, Tatsuhiro Tsujikawa
and that's the whole page, bestie!! π§ this was WSLAY_EVENT_QUEUE_MSG_EX(3) from @PACKAGE_VERSION@, dated Apr 22, 2024 β go queue something iconic πβ¨π
π¦ where this page comes from
- ubuntu noble: libwslay-doc 1.1.1-4build1 Β· MIT
- ubuntu questing: libwslay-doc 1.1.1-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms