namespace RNET
Namespace of all REDnet interfaces and classes.
Classes:
class | Adapter |
class | Address |
class | IMessage |
class | IPeer |
class | LogEntry |
class | System |
Enumerations:
Typedefs:
typedef void(* | LOG_CALLBACK )(const RNET::LogEntry &iLogEntry, void *ioUserData) |
typedef RED_RC(* | ON_CONNECTION_CLOSED_CALLBACK )(int iConnection, void *ioUserData) |
typedef RED_RC(* | ON_CONNECTION_READY_CALLBACK )(int iConnection, const RNET::Address &iAddress, void *ioUserData) |
typedef RED_RC(* | ON_DATA_RECEIVED_CALLBACK )(int iConnection, const RNET::IMessage &iMessage, void *ioUserData) |
typedef RED_RC(* | ON_DATA_REQUEST_CALLBACK )(int iConnection, const RED::String &iQuery, const RED::String &iArguments, void *ioUserData) |
typedef RED_RC(* | ON_POLL_CALLBACK )(void *ioUserData) |
typedef RED_RC(* | ON_SHUTDOWN_CALLBACK )(void *ioUserData) |
Enumerations documentation
Enumeration of the various loggable events.
Enumerator:
RLE_CUSTOM | Custom event. |
RLE_UNDEFINED | Undefined event. |
RLE_INFO_LOG_START | Log start event. |
RLE_INFO_LOG_END | Log end event. |
RLE_INFO_CONNECT | Peer connection event. |
RLE_INFO_DISCONNECT | Peer disconnection event. |
RLE_INFO_TIME_OUT | Time-out event. |
RLE_INFO_PEER_START | Peer start event. |
RLE_INFO_PEER_SHUTDOWN | Peer shutdown event. |
RLE_INFO_SYS_START | REDnet start event. |
RLE_INFO_SYS_SHUTDOWN | REDnet shutdown event. |
RLE_WARNING_NET_ERROR | Network warning event (a non-fatal error has been detected and handled). |
RLE_ERROR_NET_ERROR | Network error event (an error has been detected and not handled). |
List of different message types.
Enumerator:
MST_INVALID | Invalid message. No data. |
MST_ERROR | Message received upon a network error. No data. |
MST_DISPATCHER_REGISTRATION_REFUSED | Sent by the dispatcher when a registration request has been refused. No data. |
MST_DISPATCHER_REGISTRATION_SUCCESSFUL | Sent by the dispatcher when a peer has been successfully registered. No data. |
MST_DISPATCHER_SHUTDOWN | Sent by the dispatcher before shuting down. No data. |
MST_DISPATCHER_CONNECTION_ACCEPTED | Sent by the dispatcher when an input connection is accepted. No data. |
MST_DISPATCHER_CONNECTION_LOST | Received by a peer when its connection with the dispatcher has been abnormally close. No data. |
MST_DISPATCHER_PEER_STATUS_REQUESTED | Sent by the dispatcher to a peer when wanting to know the peer status. No data. |
MST_PEER_ALIVE | Sent by a peer to inform it's alive. No data. |
MST_PEER_STATUS_READY | Sent by a peer to inform it's ready for connection. No data. |
MST_PEER_STATUS_BUSY | Sent by a peer to inform it's busy and can't accept new connections. No data. |
MST_PEER_STATUS_UNDEFINED | Sent by a peer to inform it's in an undefined status. No data. |
MST_PEER_KILLED | Sent by a peer to inform it's been killed. No data. |
MST_PEER_REGISTRATION_REQUESTED | Sent by a peer when wanting to be registered to a dispatcher. No data. |
MST_PEER_UNREGISTRATION_REQUESTED | Sent by a peer when wanting to be unregistered from a dispatcher. No data. |
MST_PEER_LOG_REQUESTED | Sent by a peer when wanting to receive the dest log file. No data. |
MST_PEER_LOG_CONTENT | Sent by a peer with the content of its log file. Data are the log file content. |
MST_DATA_STRING | The message contains a string. Following data are the string itself. |
MST_DATA_IMAGE | The message contains an image. Following data are the image itself. |
MST_DATA_WEBSOCKET | The message contains data coming from a websocket. Data type is the one set to the websocket. |
MST_DATA_CUSTOM | The message contains data in an unknown format. |
Lists the possible status of a peer.
Enumerator:
RPS_UNDEFINED | The peer is alive but in an undefined status. |
RPS_READY | The peer is alive and ready to connect to. |
RPS_BUSY | The peer is alive but can't accept any incoming connection. |
Types documentation
Custom callback called on each network event log.
This callback can be used to intercept every network event log and process them directly.
Parameters:
iLogEntry | new log entry. |
ioUserData | user data pointer. |
Custom on peer connection ready callback.
This callback is called each time a peer accepted a connection and the connection has been successfully set between the two peers.
Parameters:
iConnection | handle of the input connection. |
iAddress | network address of the distant peer. |
ioUserData | user data pointer. |
Returns:
Custom on data request callback.
This callback is called each time data are requested by a client. If the callback can serve the request by sending the data to the connection, it must returns RED_NET_PROCESSED, otherwise it must returns RED_OK (if no error occured) to let RNET process the request.
Parameters:
iConnection | handle of the input connection. |
iQuery | string describing the requested data. |
iArguments | optional query arguments. |
ioUserData | user data pointer. |
Returns:
RED_NET_PROCESSED on success (the query was processed by the callback),
RED_FAIL otherwise.