Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::NetworkEndpointTCP Class Reference
Inheritance diagram for Burger::NetworkEndpointTCP:
Collaboration diagram for Burger::NetworkEndpointTCP:

Public Member Functions

 NetworkEndpointTCP (NetworkModule *pNetworkModule)
 
virtual ~NetworkEndpointTCP ()
 
virtual eError Close (uint_t bOrderly)
 Close and dispose of all NetworkEndpointInstance records.
 
virtual eError StartAdvertising (void)
 Enable listening for broadcast packets.
 
virtual eError StopAdvertising (void)
 Disable listening for broadcast packets.
 
eError CreateEndpoint (NetworkEndpointInstance::CallbackProc pCallback, const NetAddr_t *pAddress, NetworkEndpointInstance **ppEndpoint, uint_t bCreateSockets, eSocketFlags uSocketFlags, uint_t bPassiveMode, uint32_t uGameID, eOpenType uOpenType)
 
- Public Member Functions inherited from Burger::NetworkEndpoint
 NetworkEndpoint (NetworkModule *pNetworkModule)
 Default constructor.
 
virtual ~NetworkEndpoint ()
 Default destructor.
 
NetworkManagerGetNetworkManager (void) const
 Return the parent NetworkManager.
 
NetworkModuleGetNetworkModule (void) const
 Return the parent NetworkModule.
 
NetworkEndpointInstanceGetNetworkEndpointInstance (void) const
 Return the connected NetworkEndpointInstance.
 
void SetCallback (CallbackProc pCallback)
 Set the callback function pointer.
 
void SetCallbackContext (void *pContext)
 Set the callback function's context pointer.
 
void SetOpenType (eOpenType uOpenType)
 
eOpenType GetOpenType (void) const
 Get the open type of the endpoint.
 
eNetworkProtocol GetType (void) const
 Get the protocol type of the endpoint.
 
void SetState (eState uState)
 
eState GetState (void) const
 Get the state of the endpoint.
 
eError GetInfo (NetworkModuleInfo_t *pOutput) const
 Get information about the parent NetworkModule.
 
eError GetLocalAddress (String *pOutput)
 Return the address of the local endpoint instance.
 
eError GetRemoteAddress (String *pOutput)
 Return the address of the remote endpoint instance.
 
eError NotificationLock (eSocketFlags uFlags)
 Obtain the endpoint lock.
 
eError NotificationUnlock (eSocketFlags uFlags)
 Release the endpoint lock.
 
eError AcceptConnection (CallbackProc pCallback, void *pContext, void *pExtra)
 Try to accept a requested connection.
 
eError RejectConnection (void *pExtra)
 Reject the connection.
 
uint_t IsAlive (void)
 Return TRUE if there is an active connection.
 
eError SetTimeOut (uint32_t uTimeout=NetworkEndpointInstance::kDefaultTimeout)
 Set the timeout in milliseconds.
 
virtual eError Poll (void) noexcept
 Poll for events.
 
eError Send (uintptr_t *pBytesSent, const void *pData, uintptr_t uDataSize, NetworkEndpointInstance::eBlockMode uMode=NetworkEndpointInstance::kNonBlocking)
 Send data using guaranteed protocol.
 
eError Receive (uintptr_t *pBytesReceived, void *pData, uintptr_t uDataSize)
 Receive data using guaranteed protocol.
 
eError SendDatagram (uintptr_t *pBytesSent, const void *pData, uintptr_t uDataSize, NetworkEndpointInstance::eBlockMode uMode=NetworkEndpointInstance::kNonBlocking)
 Send data using datagram protocol.
 
eError ReceiveDatagram (uintptr_t *pBytesReceived, void *pData, uintptr_t uDataSize)
 Receive data using non-guaranteed protocol.
 

Static Public Member Functions

static NetworkEndpointTCPNew (NetworkModule *pNetworkModule)
 
- Static Public Member Functions inherited from Burger::NetworkEndpoint
static void EndpointCallback (void *pContext, NetworkEndpointInstance::eCallbackCode uCode, NetworkEndpointInstance *pInstance, eError uError, void *pExtra)
 Endpoint callback.
 

Static Public Attributes

static const int kMaximumOutstandingRequests = 4
 

Private Member Functions

 NetworkEndpointTCP (const NetworkEndpointTCP &)=delete
 
NetworkEndpointTCPoperator= (const NetworkEndpointTCP &)=delete
 
 NetworkEndpointTCP (NetworkEndpointTCP &&)=delete
 
NetworkEndpointTCPoperator= (NetworkEndpointTCP &&)=delete
 

Additional Inherited Members

- Public Types inherited from Burger::NetworkEndpoint
enum  eOpenType { kPassive , kActive }
 Enum describing how to open an endpoint. More...
 
enum  eState { kStateUnknown , kStateActive , kStateClosing , kStateClosed }
 Enum describing the state of an endpoint. More...
 
typedef void(*) CallbackProc(void *pContext, NetworkEndpointInstance::eCallbackCode uCode, NetworkEndpoint *pEndpoint, eError uError, void *pExtra)
 Function prototype for event callbacks.
 
- Public Attributes inherited from Burger::NetworkEndpoint
NetworkEndpointInstancem_pEndpointInstance
 Pointer to the endpoint instance (Head of a possible chain)
 
- Protected Attributes inherited from Burger::NetworkEndpoint
NetworkManagerm_pNetworkManager
 Parent network manager.
 
NetworkModulem_pNetworkModule
 Parent network module.
 
NetworkEndpointm_pNextEndpoint
 Next entry in the linked list of endpoints.
 
NetworkEndpointm_pParent
 Pointer to a parent endpoint (If one exists)
 
CallbackProc m_pCallback
 Function to call for Endpoint events.
 
void * m_pCallbackContext
 Application supplied pointer for the callback.
 
eOpenType m_uOpenType
 Host or client endpoint.
 
eNetworkProtocol m_uType
 Type of endpoint.
 
eState m_uState
 Asynchronous state of the endpoint.
 

Constructor & Destructor Documentation

◆ NetworkEndpointTCP() [1/3]

Burger::NetworkEndpointTCP::NetworkEndpointTCP ( const NetworkEndpointTCP & )
privatedelete

◆ NetworkEndpointTCP() [2/3]

Burger::NetworkEndpointTCP::NetworkEndpointTCP ( NetworkEndpointTCP && )
privatedelete

◆ NetworkEndpointTCP() [3/3]

Burger::NetworkEndpointTCP::NetworkEndpointTCP ( NetworkModule * pNetworkModule)

◆ ~NetworkEndpointTCP()

virtual Burger::NetworkEndpointTCP::~NetworkEndpointTCP ( )
virtual

Member Function Documentation

◆ Close()

virtual eError Burger::NetworkEndpointTCP::Close ( uint_t bOrderly)
virtual

Close and dispose of all NetworkEndpointInstance records.


Close all open endpoint instances and release the memory.

Parameters
bOrderlyTRUE if the remote machine is notified of the closure, FALSE if not.
Returns
Zero if no error, non-zero if there was an error.

Implements Burger::NetworkEndpoint.

◆ CreateEndpoint()

eError Burger::NetworkEndpointTCP::CreateEndpoint ( NetworkEndpointInstance::CallbackProc pCallback,
const NetAddr_t * pAddress,
NetworkEndpointInstance ** ppEndpoint,
uint_t bCreateSockets,
eSocketFlags uSocketFlags,
uint_t bPassiveMode,
uint32_t uGameID,
eOpenType uOpenType )

◆ New()

static NetworkEndpointTCP * Burger::NetworkEndpointTCP::New ( NetworkModule * pNetworkModule)
static

◆ operator=() [1/2]

NetworkEndpointTCP & Burger::NetworkEndpointTCP::operator= ( const NetworkEndpointTCP & )
privatedelete

◆ operator=() [2/2]

NetworkEndpointTCP & Burger::NetworkEndpointTCP::operator= ( NetworkEndpointTCP && )
privatedelete

◆ StartAdvertising()

virtual eError Burger::NetworkEndpointTCP::StartAdvertising ( void )
virtual

Enable listening for broadcast packets.


When creating a game server, it may wish to advertise its existence to the local network. This function enables the ability for this endpoint to listen for broadcast packets from a client asking for information about this server.

Returns
Zero if no error, non-zero on error.

Implements Burger::NetworkEndpoint.

◆ StopAdvertising()

virtual eError Burger::NetworkEndpointTCP::StopAdvertising ( void )
virtual

Disable listening for broadcast packets.


When creating a game server, it may wish to advertise its existence to the local network. This function disables the ability for this endpoint to listen for broadcast packets from a client asking for information about this server.

Returns
Zero if no error, non-zero on error.

Implements Burger::NetworkEndpoint.

Member Data Documentation

◆ kMaximumOutstandingRequests

const int Burger::NetworkEndpointTCP::kMaximumOutstandingRequests = 4
static