CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
CRM64Pro::NetTCPfinal

NetTCP class. More...

Detailed Description

NetTCP class.

Classes

struct  NetIPAddress
 Network address information. More...
struct  ClientInfo
 Client information struct. More...
struct  TXBackpressure
 TX backpressure watermark configuration. More...

Public Member Functions

bool info (Sint32 iMode=0) override
 Request NetTCP module information.
eNetResult init (eLogMode eLM)
 Initialize the NetTCP system.
eNetResult close ()
 Close the NetTCP system.
bool isServer () const
 Check if the server is running.
bool isClient () const
 Check if the client is running.
NetIPAddress getIP () const
 Get the IP address.
eNetResult getClientName (string &sClientName) const
 Get the client name.
bool setFeatures (eNetTCPFeature eNF, bool bEnable)
 Set advanced features.
eNetTCPFeature getFeatures () const
 Get advanced features.
eNetResult createServer (Uint16 iPort, const string &sPassword, bool bDedicated)
 Create a server.
eNetResult setCoreServerCallback (Sint32(*fnCallback)(void *pData, Sint32 iSize, void *pUser), void *pUser=nullptr)
 Set a callback function into the server thread for handling data.
eNetResult connectTo (const string &sHost, Uint16 iPort, const string &sClient, const string &sPassword)
 Connect to a server.
eNetResult sendData (const void *pData, Sint32 iSize, bool bIsQuery=true)
 Send a data package.
eNetMsg receiveData (void **ppData, Uint32 *iSize, Uint8 *pSenderIdx=nullptr)
 Receive a data package (non-blocking method).
eNetResult freeData (void *&pData)
 Free a received data package.
eNetResult requestServerClose ()
 Request server shutdown.
eNetResult requestClientClose ()
 Request local client disconnection.
eNetResult queryClientsInfo ()
 Request updated information for all connected clients.
eNetResult getClientsInfo (ClientInfo **ppClientInfo, Sint32 *iCount)
 Get the local client information snapshot.
eNetResult getPendingWrites (Uint32 *iBytes) const
 Query pending outgoing bytes on the local client stream socket.
eNetResult setTXBackpressure (Uint32 iHighWater, Uint32 iLowWater)
 Set TX backpressure watermarks used by the owner-thread flush loops.
TXBackpressure getTXBackpressure () const
 Get TX backpressure watermarks currently used by NetTCP.
eNetResult setTimeout (Sint32 iMs)
 Set the connection timeout.
Sint32 getTimeout () const
 Get the connection timeout.
eNetResult setSimDelay (Sint32 iMs)
 Simulate a connection delay.
Sint32 getSimDelay () const
 Get the simulated connection delay.