Sends the pbuf p using UDP. The pbuf is not deallocated. The datagram will be sent to the current remote_ip & remote_port stored in pcb. If the pcb is not bound to a port, it will automatically be bound to a random port. @see udp_disconnect() udp_sendto()
lwIP error code. - ERR_OK. Successful. No error occurred. - ERR_MEM. Out of memory. - ERR_RTE. Could not find route to destination address. - ERR_VAL. No PCB or PCB is dual-stack - More errors could be returned by lower protocol layers.
Related Functions
Found 13 other functions taking a udp_pcb
argument:
Sets the remote end of the pcb. This function does not generate any network traffic, but only sets the remote address of the pcb. ipaddr & port are expected to be in the same byte order as in the pcb. The udp pcb is bound to a random local port if not already bound. @see udp_disconnect()
Send data to a specified address using UDP. dst_ip & dst_port are expected to be in the same byte order as in the pcb. If the PCB already has a remote address association, it will be restored after the data is sent. @see udp_disconnect() udp_send()
Send data to a specified address using UDP. The netif used for sending can be specified. This function exists mainly for DHCP, to be able to send UDP packets on a netif that is still down. dst_ip & dst_port are expected to be in the same byte order as in the pcb. @see udp_disconnect() udp_send()
Bind an UDP PCB to a specific netif. After calling this function, all packets received via this PCB are guaranteed to have come in via the specified netif, and all outgoing packets will go out via the specified netif. @see udp_disconnect()
Receive callback function for UDP netconns. Posts the packet to conn->recvmbox or deletes it on memory error. @see udp.h (struct udp_pcb.recv) for parameters