Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
db6e883c
Commit
db6e883c
authored
May 13, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added mg_wakeup_server_ex(), removed mg_wakeup_server() and mg_iterate_over_connections()
parent
804da054
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
17 deletions
+8
-17
API.md
docs/API.md
+8
-17
No files found.
docs/API.md
View file @
db6e883c
...
...
@@ -136,23 +136,14 @@ given parameter name is not valid, NULL is returned. For valid names, return
value is guaranteed to be non-NULL. If parameter is not set, zero-length string
is returned.
void mg_iterate_over_connections(struct mg_server *, mg_handler_t func);
This is an interface primarily designed to push arbitrary data to websocket
connections at any time. This function could be called from the Mongoose thread
only. When it returns, Mongoose thread calls
`func()`
for each active
connection.
It is allowed to call
`mg_send_data()`
or
`mg_websocket_write()`
within a
callback, cause
`func`
is executed in the context of the Mongoose thread.
void mg_wakeup_server(struct mg_server *);
Makes
`mg_poll_server()`
that could be sleeping in the
`select()`
syscall
to break the call and return. This function can be called from any thread.
It is designed to let other threads wake up Mongoose thread from the sleep
and let it do a fresh new IO iteration over all connection. Usually it is done
when other threads decides there is new data ready to be sent by Mongoose.
void mg_wakeup_server_ex(struct mg_server *, mg_handler_t func,
const char *fmt, ...);
Sends string message to a server. Function
`func`
is called for every active
connection. String message is passed in
`struct mg_connection::callback_param`
.
This function is designed to push data to the connected clients, and
can be called from any thread. There is a limitation on the length of
the message, currently at 8 kilobytes.
void mg_send_status(struct mg_connection *, int status_code);
void mg_send_header(struct mg_connection *, const char *name,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment