Documentation for the Unreal C++ Library
Loading...
Searching...
No Matches
FPVROBeacon Class Reference

#include <PVROBeacon.h>

Public Member Functions

 FPVROBeacon ()
 
virtual ~FPVROBeacon ()
 
bool BroadcastPacket (uint8 *Packet, int32 Length)
 
bool BroadcastPacketFromSocket (uint8 *Packet, int32 Length)
 
 DEFINE_ONLINE_DELEGATE_ONE_PARAM (OnPortChanged, int32)
 
bool Init (int32 Port)
 
bool InitClient (int32 IP, int32 Port, int32 ListenPort)
 
bool InitHost (int32 Port)
 
bool IsListenSocketValid () const
 
int32 ReceivePacket (uint8 *PacketData, int32 BufferSize)
 

Private Attributes

TSharedPtr< class FInternetAddr > BroadcastAddr
 
TSharedPtr< class FInternetAddr > ListenAddr
 
class FSocket * ListenSocket
 
TSharedRef< class FInternetAddr > SockAddr
 

Detailed Description

Class responsible for sending/receiving UDP broadcasts for LAN match discovery

Definition at line 38 of file PVROBeacon.h.

Constructor & Destructor Documentation

◆ FPVROBeacon()

FPVROBeacon::FPVROBeacon ( void )

Sets the broadcast address for this object

Definition at line 16 of file PVROBeacon.cpp.

◆ ~FPVROBeacon()

FPVROBeacon::~FPVROBeacon ( void )
virtual

Frees the broadcast socket

Definition at line 23 of file PVROBeacon.cpp.

Member Function Documentation

◆ BroadcastPacket()

bool FPVROBeacon::BroadcastPacket ( uint8 * Packet,
int32 Length )

Uses the cached broadcast address to send packet to a subnet

Parameters
Packetthe packet to send
Lengththe size of the packet to send

Definition at line 195 of file PVROBeacon.cpp.

Here is the caller graph for this function:

◆ BroadcastPacketFromSocket()

bool FPVROBeacon::BroadcastPacketFromSocket ( uint8 * Packet,
int32 Length )

Uses the cached socket address to send packet to a subnet

Parameters
Packetthe packet to send
Lengththe size of the packet to send

Definition at line 202 of file PVROBeacon.cpp.

Here is the caller graph for this function:

◆ DEFINE_ONLINE_DELEGATE_ONE_PARAM()

FPVROBeacon::DEFINE_ONLINE_DELEGATE_ONE_PARAM ( OnPortChanged ,
int32  )

◆ Init()

bool FPVROBeacon::Init ( int32 Port)

Initializes the socket

Parameters
Portthe port to listen on
Returns
true if both socket was created successfully, false otherwise

Definition at line 35 of file PVROBeacon.cpp.

Here is the caller graph for this function:

◆ InitClient()

bool FPVROBeacon::InitClient ( int32 IP,
int32 Port,
int32 ListenPort )

Initializes the socket for the client in online connection

Parameters
IPthe address to connect to
Portthe port to connect to
ListenPortthe port to listen on
Returns
true if both socket was created successfully, false otherwise

Definition at line 121 of file PVROBeacon.cpp.

Here is the caller graph for this function:

◆ InitHost()

bool FPVROBeacon::InitHost ( int32 Port)

Initializes the socket for host in online connection

Parameters
Portthe port to listen on
Returns
true if both socket was created successfully, false otherwise

Definition at line 76 of file PVROBeacon.cpp.

Here is the caller graph for this function:

◆ IsListenSocketValid()

bool FPVROBeacon::IsListenSocketValid ( ) const

Return true if there is a valid ListenSocket

Definition at line 30 of file PVROBeacon.cpp.

◆ ReceivePacket()

int32 FPVROBeacon::ReceivePacket ( uint8 * PacketData,
int32 BufferSize )

Called to poll the socket for pending data. Any data received is placed in the specified packet buffer

Parameters
PacketDatathe buffer to get the socket's packet data
BufferSizethe size of the packet buffer
Returns
the number of bytes read (0 if none or an error)

Definition at line 177 of file PVROBeacon.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ BroadcastAddr

TSharedPtr<class FInternetAddr> FPVROBeacon::BroadcastAddr
private

Builds the broadcast address and caches it

Definition at line 41 of file PVROBeacon.h.

◆ ListenAddr

TSharedPtr<class FInternetAddr> FPVROBeacon::ListenAddr
private

The address in bound requests come in on

Definition at line 45 of file PVROBeacon.h.

◆ ListenSocket

class FSocket* FPVROBeacon::ListenSocket
private

The socket to listen for requests on

Definition at line 43 of file PVROBeacon.h.

◆ SockAddr

TSharedRef<class FInternetAddr> FPVROBeacon::SockAddr
private

Temporary address when receiving packets

Definition at line 47 of file PVROBeacon.h.


The documentation for this class was generated from the following files: