C++ IP API  9.5.7
TCP & UDP for virtual user scripts
UdpLink.h
Go to the documentation of this file.
1 #pragma once
2 #include "IpResponses.h"
3 #include "IpEndPoint.h"
4 #include "UdpPropertiesInterface.h"
5 #include "IpLinkInterface.h"
6 #include <memory>
7 
8 namespace Facilita
9 {
10  class UdpLinkImpl;
23  #pragma warning (disable : 4638)
24  class IP_API UdpLink: public UdpPropertiesInterface, IpLinkInterface {
25  friend class UdpLinkFactory;
26 
27  public:
29  UdpLink();
31  UdpLink(const UdpLink& other);
32  virtual ~UdpLink();
33 
36  UdpLink& operator=(UdpLink& other);
37 
42  UdpLink withRemoteIpEndPoint(const IpEndPoint& remoteIpEndPoint);
43 
49  int send(const string &text, int reference=0);
50 
54  ReceiveResponse receive();
55 
58  void close();
59 
63  int maxUdpSize() const;
64 
68 
72  int getSendRetries() const ;
75  void setSendRetries(int retries);
80  int getBufferSize() const ;
83  void setBufferSize(int bufferSize);
88  int getDnsTimeout() const;
91  void setDnsTimeout(int timeout);
96  int getDnsRetries() const;
99  void setDnsRetries(int retries);
104  int getReceiveTimeout() const;
107  void setReceiveTimeout(int timeout);
109 
113  int getLinkTimeout() const;
116  void setLinkTimeout(int timeout);
120  bool isLoggingEnabled() const;
122 
126  IpEndPoint getRemoteIpEndPoint() const;
129  IpEndPoint getLocalIpEndPoint() const;
130 
131  void suspendLogging();
132  void resumeLogging();
133 
138  string toString() const;
139 
142  int getLinkNumber() const;
145  private:
146  UdpLink(UdpLinkImpl* impl);
147 
148  #pragma warning (disable : 4251)
149  shared_ptr<UdpLinkImpl> _impl;
150  #pragma warning(default:4251)
151  };
152 }
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
Objects of this class are returned by receive methods.
Definition: IpResponses.h:89
Definition: IpEndPoint.h:9