udpc_open()
#
udpc_open()
initializes and opens a UDP client for logging, configuring its buffer size, frame size, and output format.
Prototype
udpc_t udpc_open(
const char *url,
const char *bindip,
const char *if_name,
size_t bf_size,
size_t udp_frame_size,
output_format_t output_format,
BOOL exit_on_fail
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The destination URL for the UDP client. |
|
|
The local IP address to bind the socket, or NULL for default. |
|
|
The network interface name to bind the socket, or NULL for default. |
|
|
The buffer size in bytes; 0 defaults to 256 KB. |
|
|
The maximum UDP frame size; 0 defaults to 1500 bytes. |
|
|
The output format for logging; defaults to |
|
|
If |
Return Value
Returns a udpc_t
handle to the UDP client on success, or NULL
on failure.
Notes
If url
is empty or invalid, udpc_open()
returns NULL
.
Memory is allocated dynamically for the buffer; ensure proper cleanup with udpc_close()
.
If the socket cannot be created, the function logs an error and returns NULL
.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples