summaryrefslogtreecommitdiff
path: root/src/net_common.h
diff options
context:
space:
mode:
authorSimon Howard2006-01-10 19:59:26 +0000
committerSimon Howard2006-01-10 19:59:26 +0000
commitae7adeeda69cc61ed4e9409b0a4d3d13b5d40332 (patch)
tree26108f1655e2f62fd7e6090d85ec2279e36a1a0b /src/net_common.h
parentfc969e4981a2365304f88e664d625c3a07d57bee (diff)
downloadchocolate-doom-ae7adeeda69cc61ed4e9409b0a4d3d13b5d40332.tar.gz
chocolate-doom-ae7adeeda69cc61ed4e9409b0a4d3d13b5d40332.tar.bz2
chocolate-doom-ae7adeeda69cc61ed4e9409b0a4d3d13b5d40332.zip
Reliable packet transport mechanism
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 279
Diffstat (limited to 'src/net_common.h')
-rw-r--r--src/net_common.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net_common.h b/src/net_common.h
index 530a0e0d..4f5605dc 100644
--- a/src/net_common.h
+++ b/src/net_common.h
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_common.h 264 2006-01-08 02:53:05Z fraggle $
+// $Id: net_common.h 279 2006-01-10 19:59:26Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.3 2006/01/10 19:59:26 fraggle
+// Reliable packet transport mechanism
+//
// Revision 1.2 2006/01/08 02:53:05 fraggle
// Send keepalives if the connection is not doing anything else.
// Send all packets using a new NET_Conn_SendPacket to support this.
@@ -37,6 +40,7 @@
#define NET_COMMON_H
#include "net_defs.h"
+#include "net_packet.h"
typedef enum
{
@@ -74,6 +78,8 @@ typedef enum
#define MAX_RETRIES 5
+typedef struct net_reliable_packet_s net_reliable_packet_t;
+
typedef struct
{
net_connstate_t state;
@@ -82,6 +88,9 @@ typedef struct
int num_retries;
int keepalive_send_time;
int keepalive_recv_time;
+ net_reliable_packet_t *reliable_packets;
+ int reliable_send_seq;
+ int reliable_recv_seq;
} net_connection_t;
@@ -89,9 +98,10 @@ void NET_Conn_SendPacket(net_connection_t *conn, net_packet_t *packet);
void NET_Conn_InitClient(net_connection_t *conn, net_addr_t *addr);
void NET_Conn_InitServer(net_connection_t *conn, net_addr_t *addr);
boolean NET_Conn_Packet(net_connection_t *conn, net_packet_t *packet,
- int packet_type);
+ unsigned int *packet_type);
void NET_Conn_Disconnect(net_connection_t *conn);
void NET_Conn_Run(net_connection_t *conn);
+net_packet_t *NET_Conn_NewReliable(net_connection_t *conn, int packet_type);
#endif /* #ifndef NET_COMMON_H */