Commit 43c317ef authored by Evelyn's avatar Evelyn Committed by GitHub

Update mg_broadcast.md

parent 01ffdb69
...@@ -6,14 +6,14 @@ signature: | ...@@ -6,14 +6,14 @@ signature: |
void mg_broadcast(struct mg_mgr *, mg_event_handler_t func, void *, size_t); void mg_broadcast(struct mg_mgr *, mg_event_handler_t func, void *, size_t);
--- ---
Pass a message of a given length to all connections. Passes a message of a given length to all connections.
Must be called from a thread that does NOT call `mg_mgr_poll()`. Must be called from a thread that does NOT call `mg_mgr_poll()`.
Note that `mg_broadcast()` is the only function Note that `mg_broadcast()` is the only function
that can be, and must be, called from a different (non-IO) thread. 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 `func` callback function will be called by the IO thread for each
connection. When called, event would be `MG_EV_POLL`, and message will connection. When called, the event will be `MG_EV_POLL`, and a message will
be passed as `ev_data` pointer. Maximum message size is capped be passed as the `ev_data` pointer. Maximum message size is capped
by `MG_CTL_MSG_MESSAGE_SIZE` which is set to 8192 bytes. by `MG_CTL_MSG_MESSAGE_SIZE` which is set to 8192 bytes.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment