eCosPro® Reference Manual
Prev |  | Next

# udp_recv()

## Name

udp_recv() -- Set callback for incoming UDP data

## Synopsis

`void udp_recv`(struct udp_pcb *pcb, err_t (*recv) (void *arg, struct udp_pcb *upcb, struct pbuf *p, struct ip_addr *addr, u16_t port), void *recv_arg);

## Description

Registers a callback function recv with the PCB pcb so that when a UDP datagram is received, the callback is invoked. The callback argument arg is set as the argument recv_arg to `udp_recv()`. The received datagram packet buffer is held in p. The source address of the datagram is provided in addr, and the source port in port. The callback is expected to free the packet.

Prev | Home | Next
udp_send() | Up | System initialisation