| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /*
- ** Command & Conquer Red Alert(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /* $Header: F:\projects\c&c\vcs\code\seqconn.h_v 1.13 01 Mar 1996 17:45:24 JOE_BOSTIC $ */
- /***************************************************************************
- ** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
- ***************************************************************************
- * *
- * Project Name : Command & Conquer *
- * *
- * File Name : SEQCONN.H *
- * *
- * Programmer : Bill Randolph *
- * *
- * Start Date : December 19, 1994 *
- * *
- * Last Update : April 9, 1995 [BR] *
- * *
- *-------------------------------------------------------------------------*
- * *
- * This class provides a "Sequenced" ACK/Retry approach to packet *
- * transmission. It waits until the last packet has been ACK'd before *
- * sending another packet. Thus, it guarantees order of delivery of *
- * packets, but its performance will be slower than the Non-Sequenced *
- * approach. *
- * *
- * A derived class must provide: *
- * - Init: Initialization of any hardware-specific values. *
- * - Send: a hardware-dependent send routine. *
- * *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #ifndef SEQCONN_H
- #define SEQCONN_H
- #include "connect.h"
- #include "comqueue.h"
- /*
- ***************************** Class Declaration *****************************
- */
- class SequencedConnClass : public ConnectionClass
- {
- /*
- ---------------------------- Public Interface ----------------------------
- */
- public:
- /*.....................................................................
- Constructor/destructor.
- .....................................................................*/
- SequencedConnClass (int numsend, int numrecieve, int maxlen,
- unsigned short magicnum, unsigned long retry_delta,
- unsigned long max_retries, unsigned long timeout);
- virtual ~SequencedConnClass ();
- /*.....................................................................
- Initialization.
- .....................................................................*/
- virtual void Init (void);
- /*.....................................................................
- Send/Receive routines.
- .....................................................................*/
- virtual int Send_Packet (void * buf, int buflen, int ack_req);
- virtual int Receive_Packet (void * buf, int buflen);
- virtual int Get_Packet (void * buf, int *buflen);
- /*.....................................................................
- The packet queue.
- .....................................................................*/
- CommQueueClass *Queue;
- /*
- -------------------------- Protected Interface ---------------------------
- */
- protected:
- /*.....................................................................
- Routines to service the Send & Receive queues.
- .....................................................................*/
- virtual int Service_Send_Queue (void);
- virtual int Service_Receive_Queue (void);
- /*.....................................................................
- Running totals of # of packets we send & receive which require an ACK,
- and those that don't.
- .....................................................................*/
- unsigned long NumRecNoAck;
- unsigned long NumRecAck;
- unsigned long NumSendNoAck;
- unsigned long NumSendAck;
- };
- #endif
- /*************************** end of seqconn.h ******************************/
|