VR-Forces 4.5 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  bool useBlockingSend=false);
36 
39 
41  virtual void deliver(DtMessage& msg);
42 
45  void sendAndFlush();
46 
48  virtual void getServerMessages(MessageList&);
49 
51  void connectToListener(const std::string& address,int port);
52 
54  void disconnect();
55 
59  virtual bool validateConnection();
60 
62  virtual bool isConnected() const;
63 
65  int socket() const;
66 
68  virtual int port() const;
69 
71  const std::string& address() const;
72 
74  void readData();
75 
77  bool isOk() const;
78 
80  static void getUniqueClientName(std::string& nameOut);
81 
83  virtual const std::string& name() const;
84 
86  static std::string errorString(int code);
87 
89  const DtDeRecord& connectionRecord();
90 
91  double sendTimeout() const;
92 
93  protected:
94 
95  void setSocket(int socket);
96 
99  bool receiveIgRecord(DtDeRecord& name);
100 
102 
103  bool receiveString(std::string& string);
104  bool receiveInt( int& value);
105  bool sendString( const std::string& name );
106  bool sendInt( int value);
108 
111  bool sendIGRecord(const DtDeRecord& record);
112 
113 
114  int lastError();
115 
117  void getMessagesFromData();
118 
120 
121  int mySocket;
122  std::string myAddress;
123  int myPort;
124  bool myOkFlag;
126 
127 
132 
133  };
134 }
135 
136 #endif

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)