UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IPlatformHostSocket Class Referenceabstract

#include <GenericPlatformHostSocket.h>

Public Types

enum class  EResultNet : uint8 {
  Ok , ErrorUnknown , ErrorInvalidArgument , ErrorInvalidConnection ,
  ErrorInterrupted , ErrorHostNotConnected
}
 
enum class  EConnectionState : uint8 {
  Unknown , Created , Connected , Disconnected ,
  Closed
}
 
enum class  EReceiveFlags : uint8 { DontWait , WaitAll }
 

Public Member Functions

virtual EResultNet Send (const void *Buffer, uint64 BytesToSend)=0
 
virtual EResultNet Receive (void *Buffer, uint64 BytesToReceive)=0
 
virtual EResultNet Receive (void *Buffer, uint64 BytesToReceive, uint64 &BytesReceived, EReceiveFlags ReadMode=EReceiveFlags::WaitAll)=0
 
virtual EConnectionState GetState () const =0
 
virtual ~IPlatformHostSocket ()
 

Detailed Description

Interface for sockets supporting direct communication between the game running on the target device and a connected PC.

It represents a custom communication channel and may not be implemented on all platforms.

It is meant to be used in development ONLY.

See also
IPlatformHostCommunication

Member Enumeration Documentation

◆ EConnectionState

State of the socket determining its ability to send/receive data.

See also
GetState
Enumerator
Unknown 
Created 
Connected 
Disconnected 
Closed 

◆ EReceiveFlags

Mode of a socket read

Enumerator
DontWait 
WaitAll 

◆ EResultNet

Status values returned by Send and Receive members.

See also
Send, Receive
Enumerator
Ok 
ErrorUnknown 
ErrorInvalidArgument 
ErrorInvalidConnection 
ErrorInterrupted 
ErrorHostNotConnected 

Constructor & Destructor Documentation

◆ ~IPlatformHostSocket()

virtual IPlatformHostSocket::~IPlatformHostSocket ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ GetState()

virtual EConnectionState IPlatformHostSocket::GetState ( ) const
pure virtual

Get the state of the socket (determines if the host pc is connected and communication is possible).

◆ Receive() [1/2]

virtual EResultNet IPlatformHostSocket::Receive ( void Buffer,
uint64  BytesToReceive 
)
pure virtual

Receive data from the connected host PC (blocking operation).

Parameters
BufferData to be sent.
BytesToReceiveThe number of bytes to receive (Buffer has to be large enough).
Returns
Status value indicating error or success.

◆ Receive() [2/2]

virtual EResultNet IPlatformHostSocket::Receive ( void Buffer,
uint64  BytesToReceive,
uint64 BytesReceived,
EReceiveFlags  ReadMode = EReceiveFlags::WaitAll 
)
pure virtual

Receive data from the connected host PC.

Parameters
BufferData to be sent.
BytesToReceiveThe number of bytes to receive (Buffer has to be large enough).
BytesReceivedNumber of bytes that have been received (equals to BytesToReceive if ReadMode is EReceiveFlags::WaitAll)
ReadModeDontWait if this call should return immediately with the data available and not wait for BytesToReceive number of bytes
Returns
Status value indicating error or success.

◆ Send()

virtual EResultNet IPlatformHostSocket::Send ( const void Buffer,
uint64  BytesToSend 
)
pure virtual

Send data to the connected host PC (blocking operation).

Parameters
BufferData to be sent.
BytesToSendThe number of bytes to send.
Returns
Status value indicating error or success.

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