UdpSocket_receiveFrom

Function UdpSocket_receiveFrom 

Source
pub unsafe extern "C" fn UdpSocket_receiveFrom(
    self_: UdpSocket,
    address: *mut c_char,
    maxAddrSize: c_int,
    msg: *mut u8,
    msgSize: c_int,
) -> c_int
Expand description

Receive data from UDP socket (store data and (optionally) the IP address of the sender

§Arguments

  • self - UDP socket instance
  • address - (optional) buffer to store the IP address as string
  • maxAddrSize - (optional) size of the provided buffer to store the IP address
  • msg - buffer to store the UDP message data
  • msgSize - the maximum size of the message to receive

§Returns

number of received bytes or -1 in case of an error