|
ecsnet
|
Manages all active network connections (peers) for a client or server. More...
#include <connection_manager.h>

Public Attributes | |
| peer_t | peers [MAX_PEERS] |
| int | peer_count |
| net_socket_t | listen_sockets [PROTOCOL_COUNT] |
| bool | is_server |
| void * | user_data |
| void(* | on_receive )(void *, peer_t *, const void *, int) |
| void(* | on_connect )(void *, peer_t *) |
| void(* | on_disconnect )(void *, peer_t *) |
Manages all active network connections (peers) for a client or server.
This structure holds an array of all connected peers, manages the listen sockets, and stores pointers to peer related callback functions for network events.
| bool connection_manager_t::is_server |
A flag indicating if this instance is a server.
| net_socket_t connection_manager_t::listen_sockets[PROTOCOL_COUNT] |
Sockets for listening on both TCP and UDP.
| void(* connection_manager_t::on_connect) (void *, peer_t *) |
The callback for when a new peer connects.
| void(* connection_manager_t::on_disconnect) (void *, peer_t *) |
The callback for when a peer disconnects.
| void(* connection_manager_t::on_receive) (void *, peer_t *, const void *, int) |
The callback for when data is received.
| int connection_manager_t::peer_count |
The current number of active peers.
| peer_t connection_manager_t::peers[MAX_PEERS] |
An array of all managed peers.
| void* connection_manager_t::user_data |
User data passed to callbacks