tcp_bind() — Bind PCB to local IP address and port


err_t tcp_bind (struct tcp_pcb *pcb , struct ip_addr *ipaddr , u16_t port );


Binds pcb to a local IP address and port number. The IP address can be specified as IP_ADDR_ANY in order to bind the connection to all local IP addresses.

Return value

If another connection is bound to the same port, the function will return ERR_USE, otherwise ERR_OK is returned.