VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTcpMessageClient.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtRemoteIGITCPClient_H_
11 #define DtRemoteIGITCPClient_H_
12 
13 #include <vrvCore/vrvCore.h>
16 #include <vrvCore/DtDeRecord.h>
17 
18 #include <string>
19 
20 namespace makVrv
21 {
22  class DtDe;
23 
27  {
28  public:
29 
31  DtTcpMessageClient( DtDe& de,int socket, const std::string& localAddress, int port,
32  bool useBlockingSend=false);
33 
35  virtual ~DtTcpMessageClient();
36 
38  virtual void deliver(DtMessage& msg);
39 
42  void sendAndFlush();
43 
45  virtual void getServerMessages(MessageList&);
46 
48  void connectToListener(const std::string& address,int port);
49 
51  void disconnect();
52 
56  virtual bool validateConnection();
57 
59  virtual bool isConnected() const;
60 
62  int socket() const;
63 
65  virtual int port() const;
66 
68  const std::string& address() const;
69 
71  void readData();
72 
74  bool isOk() const;
75 
77  static void getUniqueClientName(std::string& nameOut);
78 
80  virtual const std::string& name() const;
81 
83  static std::string errorString(int code);
84 
86  const DtDeRecord& connectionRecord();
87 
88  double sendTimeout() const;
89 
90  protected:
91 
92  void setSocket(int socket);
93 
96  bool receiveIgRecord(DtDeRecord& name);
97 
99  bool receiveString(std::string& string);
101  bool receiveInt( int& value);
102  bool sendString( const std::string& name );
103  bool sendInt( int value);
105 
108  bool sendIGRecord(const DtDeRecord& record);
109 
110 
111  int lastError();
112 
114  void getMessagesFromData();
115 
117 
118  int mySocket;
119  std::string myAddress;
120  int myPort;
121  bool myOkFlag;
123 
124 
129 
130  };
131 }
132 
133 #endif
DtDeRecord myRecord
Definition: DtTcpMessageClient.h:127
bool myOkFlag
Definition: DtTcpMessageClient.h:121
Contains makVrv::DtDeRecord class.
The IGI Message. Is easily encoded and decoding using stream operators. It also provides validation d...
Definition: DtMessage.h:30
Class for serializing objects as a byte stream for transmitting to othe rdisplay engines.
Definition: DtMessageStream.h:22
A remote TCP client that the TCP server communicates with.
Definition: DtTcpMessageClient.h:26
DtMessageStream myOutputStream
Definition: DtTcpMessageClient.h:126
A Record of an IG instance.
Definition: DtDeRecord.h:24
Contains makVrv:DtMessageStream class.
bool myUseBlockingSend
Definition: DtTcpMessageClient.h:128
int myPort
Definition: DtTcpMessageClient.h:120
std::vector< DtMessage * > MessageList
Definition: DtMessageClient.h:42
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
std::string myAddress
Definition: DtTcpMessageClient.h:119
int mySocket
Definition: DtTcpMessageClient.h:118
double mySendTimeout
Definition: DtTcpMessageClient.h:122
IGI Client is responsible for delivering IGI messages to other remote managers. IGI Client is the abs...
Definition: DtMessageClient.h:27
Contains DtIGIClient class.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
DtMessageStream myInputStream
Definition: DtTcpMessageClient.h:125
DtDe & myDe
Definition: DtTcpMessageClient.h:116
Contains DLL export macros.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)