Remote Call Framework 3.2
UdpEndpoint.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2020, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 3.2
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
19 #ifndef INCLUDE_RCF_UDPENDPOINT_HPP
20 #define INCLUDE_RCF_UDPENDPOINT_HPP
21 
22 #include <memory>
23 #include <string>
24 
25 #include <RCF/Endpoint.hpp>
26 #include <RCF/Export.hpp>
27 #include <RCF/IpAddress.hpp>
28 
29 namespace RCF {
30 
31  class ServerTransport;
32  class ClientTransport;
33 
35  class RCF_EXPORT UdpEndpoint : public Endpoint
36  {
37  public:
38 
39  // *** SWIG BEGIN ***
40 
42  UdpEndpoint(int port);
43 
45  UdpEndpoint(const std::string &ip, int port);
46 
47  std::string getIp() const;
48  int getPort() const;
49  std::string asString() const;
50 
52  void enableSharedAddressBinding(bool enable = true);
53 
55  void listenOnMulticast(const IpAddress & multicastIp);
56 
58  void listenOnMulticast(const std::string & multicastIp);
59 
60  // *** SWIG END ***
61 
62  UdpEndpoint();
63  UdpEndpoint(const IpAddress & ipAddress);
64  UdpEndpoint(const UdpEndpoint &rhs);
65 
66  std::unique_ptr<ServerTransport> createServerTransport() const;
67  std::unique_ptr<ClientTransport> createClientTransport() const;
68  EndpointPtr clone() const;
69 
70  private:
71  IpAddress mIp;
72  IpAddress mMulticastIp;
73  bool mEnableSharedAddressBinding;
74  };
75 
76 } // namespace RCF
77 
78 #endif // ! INCLUDE_RCF_UDPENDPOINT_HPP
Represents a UDP endpoint.
Definition: UdpEndpoint.hpp:35
std::shared_ptr< Endpoint > EndpointPtr
Reference counted wrapper for RCF::Endpoint.
Definition: RcfFwd.hpp:118
Base class for all network endpoint types.
Definition: Endpoint.hpp:41
Definition: AmiIoHandler.hpp:24
Represents an IP address (IPv4 or IPv6).
Definition: IpAddress.hpp:67