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

NetTCP class. More...

Detailed Description

NetTCP class.

Classes

struct  NetIPAddress
 Network address information. More...
struct  ClientInfo
 Client information struct. More...

Public Member Functions

bool info (Sint32 iMode=0) override
 Request NetTCP Interface 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, Sint32 iDedicated)
 Create a server.
eNetResult setCoreServerCallback (Sint32(*myCoreServer)(void *pData, Sint32 iSize, void *pObj), void *pObj=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 (void *pData, Sint32 iSize, Uint8 bIsQuery=1)
 Send a data package.
eNetMsg receiveData (void **pData, Uint32 *iSize, Uint8 *senderID=nullptr)
 Receive a data package (non-blocking method).
eNetResult freeData (void *&pData)
 Free a received data package.
eNetResult queryKillServer ()
 Query to close the server (and all the connected clients).
eNetResult queryKillClient ()
 Query to kill this client.
eNetResult queryClientsInfo ()
 Query to get updated the information of all connected clients.
Sint32 getClientsInfo (ClientInfo **cinfo)
 Get information stored locally about all connected clients.
Sint32 getPendingWrites () const
 Query pending outgoing bytes on the local client stream socket.
eNetResult setTXSoftBrake (Uint32 iHighWater, Uint32 iLowWater)
 Set TX soft-brake watermarks used by the owner-thread flush loops.
eNetResult getTXSoftBrake (Uint32 *iHighWater, Uint32 *iLowWater) const
 Get TX soft-brake watermarks currently used by NetTCP.
Sint32 setTimeOut (Sint32 iMs)
 Set the connection timeout.
Sint32 setSimDelay (Sint32 iMs, Sint32 iMode=0)
 Simulate a connection delay.