C++ IP API  9.5.8
TCP & UDP for virtual user scripts
TcpConnectionFactory.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Ip.h"
4 #include "TcpConnection.h"
5 #include "TcpClientConnection.h"
6 #include "TcpPropertiesInterface.h"
7 
8 class VirtualUserInterface;
9 namespace Facilita
10 {
11  class TcpResponderFactory;
12  class LockableLog;
13  class TcpProperties;
14  class IpEndPoint;
15  class TcpClientConnectionImpl;
16  class TcpFactoryProperties;
24  class IP_API TcpConnectionFactory: public TcpPropertiesInterface
25  {
26  public:
28  TcpConnectionFactory(VirtualUserInterface* vu, LockableLog* log, TcpFactoryProperties* properties);
29  virtual ~TcpConnectionFactory();
30 
34 
44  TcpClientConnection createClient(const IpEndPoint& remoteIpEndPoint, bool secure=false);
54  TcpClientConnection createClient(const IpEndPoint& localIpEndPoint, const IpEndPoint& remoteIpEndPoint, bool secure=false);
63  TcpConnection waitForConnection(const IpEndPoint& localIpEndPoint, bool secure=false);
65 
67  TcpClientConnectionImpl* createClientImpl(const IpEndPoint& remoteIpEndPoint, bool secure=false);
68  TcpClientConnectionImpl* createClientImpl(const IpEndPoint& localIpEndPoint, const IpEndPoint& remoteIpEndPoint, bool secure=false);
69  TcpConnectionImpl* waitForConnectionImpl(const IpEndPoint& localIpEndPoint, bool secure=false);
71 
75 
79  int getConnectRetries() const;
81  void setConnectRetries(int retries);
85  int getBufferSize() const;
86  void setBufferSize(int bufferSize);
91  int getDnsTimeout() const;
93  void setDnsTimeout(int timeout);
97  int getDnsRetries() const;
99  void setDnsRetries(int retries);
103  int getConnectTimeout() const;
105  void setConnectTimeout(int timeout);
109  int getReceiveTimeout() const;
111  void setReceiveTimeout(int timeout);
115  int getSendTimeout() const;
117  void setSendTimeout(int timeout);
121  bool isLoggingEnabled() const;
125  DataRatePacer& getDataRate() const;
127  void setDataRate(int dataRate);
130 
135  int getListenTimeout() const;
137  void setListenTimeout(int timeout);
139 
141  void setLoggingEnabled(bool enable);
143  private:
144  VirtualUserInterface* _vu;
145  TcpFactoryProperties *_properties;
146  LockableLog* _log;
147  };
148 }
A factory class for the creation of TcpClientConnection and TcpConnection objects.
Definition: TcpConnectionFactory.h:24
This class encapsulates IP address and port. Static member instances represent common patterns and ad...
Definition: IpEndPoint.h:20
This class enables communication over the TCP protocol and permits connection to a server...
Definition: TcpClientConnection.h:18
#define IP_API
Definition: Ip.h:21
Definition: IpEndPoint.h:9
A TCP protocol connection endpoint that manages an underlying socket. Provides methods for sending an...
Definition: TcpConnection.h:24