NetApp_ClientStreamOpenByHostname

Connect a client to a server using a host name with a stream socket (TCP - Client)

Files

net_app.h/net_app.c

Prototype

NET_IP_ADDR_FAMILY  NetApp_ClientStreamOpenByHostname (NET_SOCK_ID              *p_sock_id,
                                                       CPU_CHAR                 *p_remote_host_name,
                                                       NET_PORT_NBR              remote_port_nbr,
                                                       NET_SOCK_ADDR            *p_sock_addr,
                                                       NET_APP_SOCK_SECURE_CFG  *p_secure_cfg,
                                                       CPU_INT32U                req_timeout_ms,
                                                       NET_ERR                  *p_err);

Arguments

p_sock_idPointer to a variable that will receive the socket ID opened from this function.
p_remote_host_namePointer to a string that contains the remote host name to resolve: Can be an IP (IPv4 or IPv6) or a host name (resolved using DNS).
remote_port_nbrPort of the remote host.
p_sock_addrPointer to a variable that will receive the socket address of the remote host. (Can be set to DEF_NULL if the returned value is not required).
p_secure_cfgPointer to the secure configuration (TLS/SSL):

DEF_NULL, if no security enabled.
Pointer to a structure that contains the TLS/SSL parameters, if the TLS/SSL must be active on the connection.
req_timeout_msConnection timeout in ms.
p_errPointer to variable that will receive the return error code from this function.

Returned Value

NET_IP_ADDR_FAMILY_IPv4, if the connected successfully using an IPv4 address.

NET_IP_ADDR_FAMILY_IPv6, if the connected successfully using an IPv6 address.

NET_IP_ADDR_FAMILY_UNKNOWN, otherwise.

Required Configuration

None.

Notes / Warnings

None.