silc_net_udp_receive

SYNOPSIS

    int
    silc_net_udp_receive(SilcStream stream, char *remote_ip_addr,
                         SilcUInt32 remote_ip_addr_size, int *remote_port,
                         unsigned char *ret_data, SilcUInt32 data_size)

DESCRIPTION

Receive a UDP packet from the `stream'. The IP address and port of the sender is returned into `remote_ip_addr' buffer and `remote_port' pointer. The packet data is returned into the `ret_data' buffer.

Returns the length of the packet, or -1 on error or 0 in case of EOF. In case of error the silc_errno will indicate the error. If the error is SILC_ERR_WOULD_BLOCK data is not currently available from the `stream'.