VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 /******************************************************************************
6 ** $RCSfile: DtTcpMessageClient.h,v $ $Revision: 1.20 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtRemoteIGITCPClient_H_
14 #define DtRemoteIGITCPClient_H_
15 
16 #include <vrvCore/vrvCore.h>
19 #include <vrvCore/DtDeRecord.h>
20 
21 #include <string>
22 
23 namespace makVrv
24 {
25  class DtDe;
26 
30  {
31  public:
32 
34  DtTcpMessageClient( DtDe& de,int socket, const std::string& localAddress, int port);
35 
38 
40  virtual void deliver(DtMessage& msg);
41 
44  void sendAndFlush();
45 
47  virtual void getServerMessages(MessageList&);
48 
50  void connectToListener(const std::string& address,int port);
51 
53  void disconnect();
54 
58  virtual bool validateConnection();
59 
61  virtual bool isConnected() const;
62 
64  int socket() const;
65 
67  virtual int port() const;
68 
70  const std::string& address() const;
71 
73  void readData();
74 
76  bool isOk() const;
77 
79  static void getUniqueClientName(std::string& nameOut);
80 
82  virtual const std::string& name() const;
83 
85  static std::string errorString(int code);
86 
88  const DtDeRecord& connectionRecord();
89 
90  double sendTimeout() const;
91 
92  protected:
93 
94  void setSocket(int socket);
95 
98  bool receiveIgRecord(DtDeRecord& name);
99 
101 
102  bool receiveString(std::string& string);
103  bool receiveInt( int& value);
104  bool sendString( const std::string& name );
105  bool sendInt( int value);
107 
110  bool sendIGRecord(const DtDeRecord& record);
111 
112 
113  int lastError();
114 
116  void getMessagesFromData();
117 
119 
120  int mySocket;
121  std::string myAddress;
122  int myPort;
123  bool myOkFlag;
125 
126 
130  };
131 }
132 
133 #endif

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)