summaryrefslogtreecommitdiffstats
path: root/src/civetweb/docs/api/mg_connect_client.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/civetweb/docs/api/mg_connect_client.md
parentInitial commit. (diff)
downloadceph-upstream/16.2.11+ds.tar.xz
ceph-upstream/16.2.11+ds.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/civetweb/docs/api/mg_connect_client.md')
-rw-r--r--src/civetweb/docs/api/mg_connect_client.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/civetweb/docs/api/mg_connect_client.md b/src/civetweb/docs/api/mg_connect_client.md
new file mode 100644
index 000000000..e2aa77398
--- /dev/null
+++ b/src/civetweb/docs/api/mg_connect_client.md
@@ -0,0 +1,29 @@
+# Civetweb API Reference
+
+### `mg_connect_client( host, port, use_ssl, error_buffer, error_buffer_size );`
+
+### Parameters
+
+| Parameter | Type | Description |
+| :--- | :--- | :--- |
+|**`host`**|`const char *`|hostname or IP address of the server|
+|**`port`**|`int`|The port to connect to on the server|
+|**`use_ssl`**|`int`|Connects using SSL of this value is not zero|
+|**`error_buffer`**|`char *`|Buffer to store an error message|
+|**`error_buffer_size`**|`size_t`|Maximum size of the error buffer including the NUL terminator|
+
+### Return Value
+
+| Type | Description |
+| :--- | :--- |
+|`struct mg_connection *`||
+
+### Description
+
+The function `mg_connect_client()` connects to a TCP server as a client. This server can be a HTTP server but this is not necessary. The function returns a pointer to a connection structure when the connection is established and NULL otherwise. The host may be on IPv4 or IPv6, but IPv6 is not enabled in every Civetweb installation. Specifically the use of IPv6 communications has to be enabled when the library is compiled. At runtime you can use the [`mg_check_feature()`](mg_check_feature.md) function with the parameter `USE_IPV6` to check if IPv6 communication is supported.
+
+### See Also
+
+* [`mg_check_feature();`](mg_check_feature.md)
+* [`mg_connect_client_secure();`](mg_connect_client_secure.md)
+* [`mg_connect_websocket_client();`](mg_connect_websocket_client.md)