mongoose/docs/c-api/net.h/mg_broadcast.md
Dmitry Frank 7bed7ff482 Docs are generated for Mongoose
Comments in headers are changed a bit: removed adoc-specific stuff,
markdown is used instead

PUBLISHED_FROM=9242cce85cc52a47a197d377e7e23804721a6bb5
2016-03-21 13:29:29 +01:00

665 B

title decl_name symbol_kind signature
mg_broadcast() mg_broadcast func void mg_broadcast(struct mg_mgr *, mg_event_handler_t func, void *, size_t);

Pass a message of a given length to all connections.

Must be called from a thread that does NOT call mg_mgr_poll(). Note that mg_broadcast() is the only function that can be, and must be, called from a different (non-IO) thread.

func callback function will be called by the IO thread for each connection. When called, event would be MG_EV_POLL, and message will be passed as ev_data pointer. Maximum message size is capped by MG_CTL_MSG_MESSAGE_SIZE which is set to 8192 bytes.