VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
eventManagerTCP.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vlutil/vlInetTcpSocket.h>
11 
16 
17 class DtInetSocket;
18 
19 struct MsgInfo
20 {
21  short site;
22  short host;
23 };
24 
26 {
29  unsigned int sequenceNumber;
30  unsigned int bufSize;
32  unsigned int datumParam;
33 };
34 
36 {
37 public:
40 
42  virtual ~DtEventManagerTCP();
43 
44  virtual void sendEvent(const makVrfEvents::DtEvent&) override;
45 
46 protected:
48  virtual void addEvent(const makVrfEvents::DtEvent&, bool& selfReflecting) override;
49 
50  virtual void processPdu(void* buffer, int size);
51 
53  virtual bool pduHeader(DtTCPHeader&, DtInetSocket*);
54 
56  virtual bool processSocket(DtInetSocket*);
57 
58  virtual char* getPacketForNetwork(const makVrfEvents::DtDataEvent& inter, size_t& length) const;
59  virtual makVrfEvents::DtDataEvent* createDataInteraction(void* buffer, size_t size) const;
60 
61  virtual bool sendEventTCP(const makVrfEvents::DtDataEvent& e);
62 
64  virtual bool sendPacketOnNetwork(char* buffer, size_t length) = 0;
65 
67  virtual bool hasNetworkConnection() const = 0;
68 };
virtual void addEvent(const makVrfEvents::DtEvent &, bool &selfReflecting) override
This is the method that is used to send the message over the TCP socket.
int messageVersion
Definition: eventManagerTCP.h:31
DtEventManagerTCP()
CTOR.
The DtEventManager handles the sending and receipt of system events (fire, detonate, command, etc). It provides a thread-safe way for the sim engine to send and receive such events, between both components within this sim engine and other remote applications.
Definition: eventManager.h:33
voidpf void uLong size
Definition: ioapi.h:39
virtual bool sendPacketOnNetwork(char *buffer, size_t length)=0
Sends the given buffer packet on the network.
MsgInfo sender
Definition: eventManagerTCP.h:27
virtual bool pduHeader(DtTCPHeader &, DtInetSocket *)
If there is a net pdu header read it.
unsigned int datumParam
Definition: eventManagerTCP.h:32
virtual void processPdu(void *buffer, int size)
virtual bool hasNetworkConnection() const =0
Return true if the TCP network is active.
Definition: event.h:13
unsigned int bufSize
Definition: eventManagerTCP.h:30
Definition: eventManagerTCP.h:19
Definition: eventManagerTCP.h:35
virtual ~DtEventManagerTCP()
DTOR.
short host
Definition: eventManagerTCP.h:22
Definition: eventManagerTCP.h:25
MsgInfo receiver
Definition: eventManagerTCP.h:28
virtual bool processSocket(DtInetSocket *)
Processes the socket, and, if there is an error, remove it.
short site
Definition: eventManagerTCP.h:21
unsigned int sequenceNumber
Definition: eventManagerTCP.h:29
class DtDataEvent
Definition: dataEvent.h:18
virtual makVrfEvents::DtDataEvent * createDataInteraction(void *buffer, size_t size) const
virtual char * getPacketForNetwork(const makVrfEvents::DtDataEvent &inter, size_t &length) const
virtual bool sendEventTCP(const makVrfEvents::DtDataEvent &e)
virtual void sendEvent(const makVrfEvents::DtEvent &) override
Pass-thru to send event directly to network manager. Override if want to not send to network manager ...

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)