Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Broadcasting data

SamuraibikerSamuraibiker Basingstoke

Hello
What is the preferred, or even defined, way of broadcasting data to multiple clients?

Currently, I have

for (c = mg_next(socket_nc->mgr, NULL); c != NULL; c = mg_next(socket_nc->mgr, c))
{
mg_send_websocket_frame(c, WEBSOCKET_OP_TEXT, data, data_len);
}

However, I frequently get an uninitialized socket (c), which then causes issues, unsurprisingly.

Any pointers, gratefully received

Thanks

Chris

Comments

Sign In or Register to comment.