GOG GALAXY SDK Documentation
ICustomNetworking Class Referenceabstract

The interface for communicating with a custom endpoint. More...

#include <ICustomNetworking.h>

Public Member Functions

virtual void OpenConnection (const char *connectionString, IConnectionOpenListener *const listener=NULL)=0
 Open a connection with a specific endpoint. More...
 
virtual void CloseConnection (ConnectionID connectionID, IConnectionCloseListener *const listener=NULL)=0
 Close a connection. More...
 
virtual void SendData (ConnectionID connectionID, const void *data, uint32_t dataSize)=0
 Send binary data over a specific connection. More...
 
virtual uint32_t GetAvailableDataSize (ConnectionID connectionID)=0
 Returns the number of bytes in a specific connection incoming buffer. More...
 
virtual void PeekData (ConnectionID connectionID, void *dest, uint32_t dataSize)=0
 Reads binary data received from a specific connection. More...
 
virtual void ReadData (ConnectionID connectionID, void *dest, uint32_t dataSize)=0
 Reads binary data received from a specific connection. More...
 
virtual void PopData (ConnectionID connectionID, uint32_t dataSize)=0
 Removes a given number of bytes from a specific connection incoming buffer. More...
 

Detailed Description

The interface for communicating with a custom endpoint.

Member Function Documentation

◆ CloseConnection()

virtual void CloseConnection ( ConnectionID  connectionID,
IConnectionCloseListener *const  listener = NULL 
)
pure virtual

Close a connection.

This call is asynchronous. Responses come to the IConnectionCloseListener.

Parameters
[in]connectionIDThe ID of the connection.
[in]listenerThe listener for specific operation.

◆ GetAvailableDataSize()

virtual uint32_t GetAvailableDataSize ( ConnectionID  connectionID)
pure virtual

Returns the number of bytes in a specific connection incoming buffer.

Parameters
[in]connectionIDThe ID of the connection.
Returns
The number of bytes in the connection incoming buffer.

◆ OpenConnection()

virtual void OpenConnection ( const char *  connectionString,
IConnectionOpenListener *const  listener = NULL 
)
pure virtual

Open a connection with a specific endpoint.

This call is asynchronous. Responses come to the IConnectionOpenListener.

Remarks
Currently only supported connection string is a WebSocket URL (e.g. ws://example.com:8000/path/to/ws).
Parameters
[in]connectionStringThe string which contains connection info.
[in]listenerThe listener for specific operation.

◆ PeekData()

virtual void PeekData ( ConnectionID  connectionID,
void *  dest,
uint32_t  dataSize 
)
pure virtual

Reads binary data received from a specific connection.

The data that was read this way is left in the connection incoming buffer.

Parameters
[in]connectionIDThe ID of the connection.
[in,out]destThe buffer to pass the data to.
[in]dataSizeThe size of the data.

◆ PopData()

virtual void PopData ( ConnectionID  connectionID,
uint32_t  dataSize 
)
pure virtual

Removes a given number of bytes from a specific connection incoming buffer.

Parameters
[in]connectionIDThe ID of the connection.
[in]dataSizeThe numbers of bytes to be removed from the buffer.

◆ ReadData()

virtual void ReadData ( ConnectionID  connectionID,
void *  dest,
uint32_t  dataSize 
)
pure virtual

Reads binary data received from a specific connection.

The data that was read this way is removed from the connection incoming buffer.

Parameters
[in]connectionIDThe ID of the connection.
[in,out]destThe buffer to pass the data to.
[in]dataSizeThe size of the data.

◆ SendData()

virtual void SendData ( ConnectionID  connectionID,
const void *  data,
uint32_t  dataSize 
)
pure virtual

Send binary data over a specific connection.

Parameters
[in]connectionIDThe ID of the connection.
[in]dataThe data to send.
[in]dataSizeThe size of the data.