Endpoints
Provides functions for creating and managing network address/port combinations used for binding and connecting.
Types
struct evpl_endpoint
Opaque structure representing a network endpoint (IP address or DNS hostname + port number). evpl_endpoints need to be resolved to an address to be used.
struct evpl_address
Opaque structure representing a resolved network address (IP + port). Generated by resolving an evpl_endpoint, or to represent the peer on received connections and datagrams.
Functions
evpl_endpoint_create
struct evpl_endpoint *evpl_endpoint_create(
const char *address,
int port);
Create an endpoint from an IP address string and port number.
Parameters:
address- IP address as string (IPv4 or IPv6), orNULL/"0.0.0.0"for wildcardport- Port number (1-65535)
Returns: Endpoint handle, or NULL on failure
Address formats:
- IPv4:
"192.168.1.100","10.0.0.1" - IPv6:
"::1","fe80::1","2001:db8::1" - Wildcard:
NULL,"0.0.0.0","::"(any address) - Hostnames:
"example.com","localhost"(resolved via DNS)
evpl_endpoint_close
void evpl_endpoint_close(struct evpl_endpoint *endpoint);
Destroy an endpoint and free its resources. Optional. If not called, endpoints are freed at process exit.
Parameters:
endpoint- Endpoint to destroy
evpl_endpoint_address
const char *evpl_endpoint_address(const struct evpl_endpoint *ep);
Get the IP/DNS address string from an endpoint.
Parameters:
ep- Endpoint to query
Returns: Pointer to address string (valid until endpoint is closed)
evpl_endpoint_port
int evpl_endpoint_port(const struct evpl_endpoint *ep);
Get the port number from an endpoint.
Parameters:
ep- Endpoint to query
Returns: Port number
See Also
- Binds & Connections API - Using endpoints with connections
- Core API - Protocol selection for endpoints
- Getting Started - Basic endpoint usage examples