mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
Document qtv connection management.
This commit is contained in:
parent
1018203f19
commit
03322f27ea
1 changed files with 36 additions and 2 deletions
|
@ -34,16 +34,50 @@
|
|||
|
||||
#include "netchan.h"
|
||||
|
||||
/** \defgroup qtv_connection Connection Management
|
||||
\ingroup qtv
|
||||
*/
|
||||
//@{
|
||||
|
||||
typedef struct connection_s {
|
||||
netadr_t address;
|
||||
void *object;
|
||||
netadr_t address; ///< Address of the remote end.
|
||||
void *object; ///< Connection specific data.
|
||||
/** Handler for incoming packets.
|
||||
\param con This connection. ("this", "self"...)
|
||||
\param obj The connection specific data (object)
|
||||
*/
|
||||
void (*handler) (struct connection_s *con, void *obj);
|
||||
} connection_t;
|
||||
|
||||
/** Initialize the connection management system.
|
||||
*/
|
||||
void Connection_Init (void);
|
||||
|
||||
/** Add a new connection.
|
||||
|
||||
\param address The address of the remote end.
|
||||
\param object Connection specific data. Will be passed to \a handler.
|
||||
\param handler Callback for handling incoming packets.
|
||||
connection_t::handler
|
||||
\return The new connection object.
|
||||
*/
|
||||
connection_t *Connection_Add (netadr_t *address, void *object,
|
||||
void (*handler)(connection_t *, void *));
|
||||
|
||||
/** Delete a connection.
|
||||
|
||||
\param con The connection to be deleted.
|
||||
*/
|
||||
void Connection_Del (connection_t *con);
|
||||
|
||||
/** Search for an established connection based on the remote address.
|
||||
|
||||
\param address The remote address.
|
||||
\return The connection associated with the remote address, or
|
||||
NULL if not found.
|
||||
*/
|
||||
connection_t *Connection_Find (netadr_t *address);
|
||||
|
||||
//@}
|
||||
|
||||
#endif//__connection_h
|
||||
|
|
Loading…
Reference in a new issue