EOS_P2P_ReceivePacket

EOS API reference page for EOS_P2P_ReceivePacket

2 mins to read

This function is part of the P2P Interface.

Remarks

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

Return Value

  • EOS_EResult::EOS_Success - If the packet was received successfully

  • EOS_EResult::EOS_InvalidParameters - If input was invalid

  • EOS_EResult::EOS_NotFound - If there are no packets available for the requesting user

See Also

EOS_P2P_GetNextReceivedPacketSize

Parameters

EOS_P2P_ReceivePacket

Parameter Type And NameUsage Information
EOS_HP2P Handle
const EOS_P2P_ReceivePacketOptions* OptionsInformation about who is requesting the size of their next packet, and how much data can be stored safely
EOS_ProductUserId* OutPeerIdThe Remote User who sent data. Only set if there was a packet to receive.
EOS_P2P_SocketId* OutSocketIdThe Socket ID of the data that was sent. Only set if there was a packet to receive.
uint8_t* OutChannelThe channel the data was sent on. Only set if there was a packet to receive.
void* OutDataBuffer to store the data being received. Must be at least EOS_P2P_GetNextReceivedPacketSize in length or data will be truncated
uint32_t* OutBytesWrittenThe amount of bytes written to OutData. Only set if there was a packet to receive.