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. | |
NetworkManager * | GetNetworkManager (void) const |
Return the parent NetworkManager. | |
NetworkModule * | GetNetworkModule (void) const |
Return the parent NetworkModule. | |
NetworkEndpointInstance * | GetNetworkEndpointInstance (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 NetworkEndpointTCP * | New (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 | |
NetworkEndpointTCP & | operator= (const NetworkEndpointTCP &)=delete |
NetworkEndpointTCP (NetworkEndpointTCP &&)=delete | |
NetworkEndpointTCP & | operator= (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 | |
NetworkEndpointInstance * | m_pEndpointInstance |
Pointer to the endpoint instance (Head of a possible chain) | |
Protected Attributes inherited from Burger::NetworkEndpoint | |
NetworkManager * | m_pNetworkManager |
Parent network manager. | |
NetworkModule * | m_pNetworkModule |
Parent network module. | |
NetworkEndpoint * | m_pNextEndpoint |
Next entry in the linked list of endpoints. | |
NetworkEndpoint * | m_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. | |
|
privatedelete |
|
privatedelete |
Burger::NetworkEndpointTCP::NetworkEndpointTCP | ( | NetworkModule * | pNetworkModule | ) |
|
virtual |
Close and dispose of all NetworkEndpointInstance records.
Close all open endpoint instances and release the memory.
Implements Burger::NetworkEndpoint.
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 ) |
|
static |
|
privatedelete |
|
privatedelete |
|
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.
Implements Burger::NetworkEndpoint.
|
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.
Implements Burger::NetworkEndpoint.
|
static |