mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 09:48:01 +08:00
docs
This commit is contained in:
parent
ff07d261b2
commit
8174842b05
@ -225,10 +225,11 @@ struct mg_connection {
|
||||
c->label[0] = 'W'; // Established websocket connection, store something
|
||||
...
|
||||
```
|
||||
- If you need to close the connection, set `c->draining = 1;` flag in your
|
||||
- If you need to close the connection, set `c->is_draining = 1;` in your
|
||||
event handler function. That tells the event manager to send all remaining
|
||||
data in a send buffer, then close the connection. If you need to close
|
||||
the connection immediately without sending data, use `c->is_closing = 1;`
|
||||
data in a send buffer ("drain" the connection), then close the connection.
|
||||
If you need to close
|
||||
the connection immediately without draining, use `c->is_closing = 1;`
|
||||
- Use `mg_http_reply()` function to create HTTP responses. That function
|
||||
properly sets the `Content-Length` header, which is important. Of course
|
||||
you can create responses manually, e.g. with `mg_printf()` function,
|
||||
|
Loading…
x
Reference in New Issue
Block a user