C++ IP API  9.5.8
TCP & UDP for virtual user scripts
UdpLinkFactory.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Ip.h"
4 #include "UdpProperties.h"
5 #include "IpEndPoint.h"
6 #include "UdpLink.h"
7 #include "UdpPropertiesInterface.h"
8 #include "Lock.h"
9 
10 class VirtualUserInterface;
11 
12 namespace Facilita
13 {
14  class UdpServerReader;
15  class UdpServerReaderFactory;
16  class LockableLog;
17  class UdpFactoryProperties;
23  class IP_API UdpLinkFactory: public UdpPropertiesInterface
24  {
25 
26  public:
28  UdpLinkFactory(VirtualUserInterface* vu, LockableLog* log, const UdpFactoryProperties* properties);
29  virtual ~UdpLinkFactory();
33 
45  UdpLink createLink(const IpEndPoint& remoteIpEndPoint);
56  UdpLink createDirectedLink(const IpEndPoint& remoteIpEndPoint);
57 
71  UdpLink createDirectedLink(const IpEndPoint& localIpEndPoint, const IpEndPoint& remoteIpEndPoint);
72 
85  UdpLink UdpLinkFactory::waitForLink(const IpEndPoint& localIpEndPoint);
87 
92 
95  int getSendRetries() const ;
98  void setSendRetries(int retries);
103  int getBufferSize() const ;
106  void setBufferSize(int bufferSize);
111  int getDnsTimeout() const;
114  void setDnsTimeout(int timeout);
119  int getDnsRetries() const;
122  void setDnsRetries(int retries);
127  int getReceiveTimeout() const;
130  void setReceiveTimeout(int timeout);
132 
135  bool isLoggingEnabled() const;
136 
139 
143 
146  int getLinkTimeout() const;
149  void setLinkTimeout(int timeout);
151 
153  UdpLinkImpl* createLinkImpl(const IpEndPoint& remoteIpEndPoint);
154  UdpLinkImpl* createDirectedLinkImpl(const IpEndPoint& remoteIpEndPoint);
155  UdpLinkImpl* createDirectedLinkImpl(const IpEndPoint& localIpEndPoint, const IpEndPoint& remoteIpEndPoint);
156  UdpLinkImpl* UdpLinkFactory::waitForLinkImpl(const IpEndPoint& localIpEndPoint);
158 
159  private:
160  UdpLinkFactory();
161  UdpLinkFactory(const UdpLinkFactory& other);
162  void setLoggingEnabled(bool enable);
163 
164  Lock _lock;
165  LockableLog* _log;
166  UdpFactoryProperties *_properties;
167  VirtualUserInterface* _vu;
168 
169  #pragma warning(disable:4251)
170  #pragma warning(default:4251)
171  };
172 }
This class encapsulates IP address and port. Static member instances represent common patterns and ad...
Definition: IpEndPoint.h:20
#define IP_API
Definition: Ip.h:21
Definition: IpEndPoint.h:9