mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Update mg_bind_opt.md
This commit is contained in:
1 parent
6df770e72d
commit
1875653b34
1 file changed
+7
-7
@@ -8,19 +8,19 @@ signature: |
|
|||||||
struct mg_bind_opts opts);
|
struct mg_bind_opts opts);
|
||||||
---
|
---
|
||||||
|
|
||||||
Create listening connection.
|
Creates a listening connection.
|
||||||
|
|
||||||
`address` parameter tells which address to bind to. It's format is the same
|
The `address` parameter specifies which address to bind to. It's format is the same
|
||||||
as for the `mg_connect()` call, where `HOST` part is optional. `address`
|
as for the `mg_connect()` call, where `HOST` part is optional. `address`
|
||||||
can be just a port number, e.g. `:8000`. To bind to a specific interface,
|
can just be a port number, e.g. `:8000`. To bind to a specific interface,
|
||||||
an IP address can be specified, e.g. `1.2.3.4:8000`. By default, a TCP
|
an IP address can be specified, e.g. `1.2.3.4:8000`. By default, a TCP
|
||||||
connection is created. To create UDP connection, prepend `udp://` prefix,
|
connection is created. To create a UDP connection, prepend a `udp://` prefix,
|
||||||
e.g. `udp://:8000`. To summarize, `address` paramer has following format:
|
e.g. `udp://:8000`. To summarise, the `address` paramer has following format:
|
||||||
`[PROTO://][IP_ADDRESS]:PORT`, where `PROTO` could be `tcp` or `udp`.
|
`[PROTO://][IP_ADDRESS]:PORT`, where `PROTO` could be `tcp` or `udp`.
|
||||||
|
|
||||||
See the `mg_bind_opts` structure for a description of the optional
|
See the `mg_bind_opts` structure for a description of the optional
|
||||||
parameters.
|
parameters.
|
||||||
|
|
||||||
Return a new listening connection, or `NULL` on error.
|
Returns a new listening connection or `NULL` on error.
|
||||||
NOTE: Connection remains owned by the manager, do not free().
|
NOTE: The connection remains owned by the manager, do not free().
|
||||||
|
|
||||||
Reference in new issue
Block a user