udp_bind() -- Bind PCB to local IP address and port


err_t udp_bind(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port);


Binds pcb to the local address indicated by ipaddr and port indicated by port. ipaddr can be IP_ADDR_ANY to indicate that it should listen to any local IP address. Port may be 0 for any port.

Return value

This function can return ERR_USE if all usable UDP dynamic ports are used (only relevant if port is 0. Otherwise udp_bind() will always return ERR_OK.

Documentation license for this page: eCosPro License