namespace RNET

Namespace of all REDnet interfaces and classes.

Classes:

classAdapter
classAddress
classIMessage
classIPeer
classLogEntry
classSystem

Enumerations:

enumLogEvent { RLE_CUSTOM =  -1, RLE_UNDEFINED =  0, RLE_INFO_LOG_START =  10, RLE_INFO_LOG_END =  11, RLE_INFO_CONNECT =  12, RLE_INFO_DISCONNECT =  13, RLE_INFO_TIME_OUT =  14, RLE_INFO_PEER_START =  15, RLE_INFO_PEER_SHUTDOWN =  16, RLE_INFO_SYS_START =  17, RLE_INFO_SYS_SHUTDOWN =  18, RLE_WARNING_NET_ERROR =  100, RLE_ERROR_NET_ERROR =  200 }
enumMessageType { MST_INVALID =  0x00, MST_ERROR =  0x01, MST_DISPATCHER_REGISTRATION_REFUSED =  0x51, MST_DISPATCHER_REGISTRATION_SUCCESSFUL =  0x52, MST_DISPATCHER_SHUTDOWN =  0x53, MST_DISPATCHER_CONNECTION_ACCEPTED =  0x54, MST_DISPATCHER_CONNECTION_LOST =  0x55, MST_DISPATCHER_PEER_STATUS_REQUESTED =  0x56, MST_PEER_ALIVE =  0xA0, MST_PEER_STATUS_READY =  0xA1, MST_PEER_STATUS_BUSY =  0xA2, MST_PEER_STATUS_UNDEFINED =  0xA3, MST_PEER_KILLED =  0xA4, MST_PEER_REGISTRATION_REQUESTED =  0xA5, MST_PEER_UNREGISTRATION_REQUESTED =  0xA6, MST_PEER_LOG_REQUESTED =  0xA7, MST_PEER_LOG_CONTENT =  0xA8, MST_DATA_STRING =  0x100, MST_DATA_IMAGE =  0x101, MST_DATA_WEBSOCKET =  0x102, MST_DATA_CUSTOM =  0xfff }
enumPeerStatus { RPS_UNDEFINED =  0, RPS_READY =  1, RPS_BUSY =  2 }

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

typedef void(* RNET::LOG_CALLBACK)(const RNET::LogEntry &iLogEntry, void *ioUserData)

Custom callback called on each network event log.

This callback can be used to intercept every network event log and process them directly.

Parameters:

iLogEntrynew log entry.
ioUserDatauser data pointer.
typedef RED_RC(* RNET::ON_CONNECTION_CLOSED_CALLBACK)(int iConnection, void *ioUserData)

Custom on peer connection closed callback.

This callback is called each time a connection is closed by the distant peer.

Parameters:

iConnectionhandle of the input connection.
ioUserDatauser data pointer.

Returns:

RED_OK on success, RED_FAIL otherwise.
typedef RED_RC(* RNET::ON_CONNECTION_READY_CALLBACK)(int iConnection, const RNET::Address &iAddress, void *ioUserData)

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:

iConnectionhandle of the input connection.
iAddressnetwork address of the distant peer.
ioUserDatauser data pointer.

Returns:

RED_OK on success, RED_FAIL otherwise.
typedef RED_RC(* RNET::ON_DATA_RECEIVED_CALLBACK)(int iConnection, const RNET::IMessage &iMessage, void *ioUserData)

Custom on data received callback.

This callback is called each time data are received through an accepted connection.

Parameters:

iConnectionhandle of the input connection.
iMessagepointer to the received message.
ioUserDatauser data pointer.

Returns:

RED_OK on success, RED_FAIL otherwise.
typedef RED_RC(* RNET::ON_DATA_REQUEST_CALLBACK)(int iConnection, const RED::String &iQuery, const RED::String &iArguments, void *ioUserData)

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:

iConnectionhandle of the input connection.
iQuerystring describing the requested data.
iArgumentsoptional query arguments.
ioUserDatauser data pointer.

Returns:

RED_OK on success (but the query was not processed by the callback),
RED_NET_PROCESSED on success (the query was processed by the callback),
RED_FAIL otherwise.
typedef RED_RC(* RNET::ON_POLL_CALLBACK)(void *ioUserData)

Custom on poll callback.

This callback is called each time REDnet performs polling.

Parameters:

ioUserDatauser data pointer.

Returns:

RED_OK on success, RED_FAIL otherwise.
typedef RED_RC(* RNET::ON_SHUTDOWN_CALLBACK)(void *ioUserData)

Custom on shutdown callback.

This callback is called when a peer is shutdown.

Parameters:

ioUserDatauser data pointer.

Returns:

RED_OK on success, RED_FAIL otherwise.