1 #ifndef GALAXY_I_CUSTOM_NETWORKING_H
2 #define GALAXY_I_CUSTOM_NETWORKING_H
Contains data structures and interfaces related to callback listeners.
The class that is inherited by all specific callback listeners and provides a static method that retu...
Definition: IListenerRegistrar.h:117
Listener for the event of closing a connection.
Definition: ICustomNetworking.h:70
CloseReason
The reason of closing a connection.
Definition: ICustomNetworking.h:77
@ CLOSE_REASON_UNDEFINED
Unspecified reason.
Definition: ICustomNetworking.h:78
virtual void OnConnectionClosed(ConnectionID connectionID, CloseReason closeReason)=0
Notification for the event of closing a connection.
Listener for the event of receiving data over the connection.
Definition: ICustomNetworking.h:99
virtual void OnConnectionDataReceived(ConnectionID connectionID, uint32_t dataSize)=0
Notification for the event of receiving data over the connection.
Listener for the events related to opening a connection.
Definition: ICustomNetworking.h:30
FailureReason
The reason of a failure in opening a connection.
Definition: ICustomNetworking.h:45
@ FAILURE_REASON_UNAUTHORIZED
Client is unauthorized.
Definition: ICustomNetworking.h:48
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: ICustomNetworking.h:46
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: ICustomNetworking.h:47
virtual void OnConnectionOpenFailure(const char *connectionString, FailureReason failureReason)=0
Notification for the event of a failure in opening a connection.
virtual void OnConnectionOpenSuccess(const char *connectionString, ConnectionID connectionID)=0
Notification for the event of a success in opening a connection.
The interface for communicating with a custom endpoint.
Definition: ICustomNetworking.h:120
virtual uint32_t GetAvailableDataSize(ConnectionID connectionID)=0
Returns the number of bytes in a specific connection incoming buffer.
virtual void PopData(ConnectionID connectionID, uint32_t dataSize)=0
Removes a given number of bytes from a specific connection incoming buffer.
virtual void ReadData(ConnectionID connectionID, void *dest, uint32_t dataSize)=0
Reads binary data received from a specific connection.
virtual void CloseConnection(ConnectionID connectionID, IConnectionCloseListener *const listener=NULL)=0
Close a connection.
virtual void PeekData(ConnectionID connectionID, void *dest, uint32_t dataSize)=0
Reads binary data received from a specific connection.
virtual void OpenConnection(const char *connectionString, IConnectionOpenListener *const listener=NULL)=0
Open a connection with a specific endpoint.
virtual void SendData(ConnectionID connectionID, const void *data, uint32_t dataSize)=0
Send binary data over a specific connection.
The class that is inherited by the self-registering versions of all specific callback listeners.
Definition: IListenerRegistrar.h:211
SelfRegisteringListener< IConnectionCloseListener > GlobalConnectionCloseListener
Globally self-registering version of IConnectionCloseListener.
Definition: ICustomNetworking.h:93
uint64_t ConnectionID
ID of a connection.
Definition: ICustomNetworking.h:24
SelfRegisteringListener< IConnectionOpenListener > GlobalConnectionOpenListener
Globally self-registering version of IConnectionOpenListener.
Definition: ICustomNetworking.h:63
SelfRegisteringListener< IConnectionDataListener > GlobalConnectionDataListener
Globally self-registering version of IConnectionDataListener.
Definition: ICustomNetworking.h:114