Skip to main content

EOS_P2P_ReceivePacket

Function EOS_P2P_ReceivePacket 

Source
pub unsafe extern "C" fn EOS_P2P_ReceivePacket(
    Handle: EOS_HP2P,
    Options: *const EOS_P2P_ReceivePacketOptions,
    OutPeerId: *mut EOS_ProductUserId,
    OutSocketId: *mut EOS_P2P_SocketId,
    OutChannel: *mut u8,
    OutData: *mut c_void,
    OutBytesWritten: *mut u32,
) -> EOS_EResult
Expand description

Receive the next packet for the local user, and information associated with this packet, if it exists.

@param Options Information about who is requesting the size of their next packet, and how much data can be stored safely @param OutPeerId The Remote User who sent data. Only set if there was a packet to receive. @param OutSocketId The Socket ID of the data that was sent. Only set if there was a packet to receive. @param OutChannel The channel the data was sent on. Only set if there was a packet to receive. @param OutData Buffer to store the data being received. Must be at least EOS_P2P_GetNextReceivedPacketSize in length or data will be truncated @param OutBytesWritten The amount of bytes written to OutData. Only set if there was a packet to receive. @return EOS_EResult containing the result of the operation. Possible result codes:

  • EOS_Success - If the packet was received successfully
  • EOS_InvalidParameters - If input was invalid
  • EOS_NotFound - If there are no packets available for the requesting user

@see EOS_P2P_GetNextReceivedPacketSize @see EOS_P2P_ReceivePacketOptions