Remote Call Framework 3.4
UdpEndpoint.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2023, Delta V Software. All rights reserved.
6 // https://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 under GPL terms.
12 //
13 // Version: 3.4
14 // Contact: support <at> deltavsoft.com
15 //
16 //******************************************************************************
17 
18 #ifndef INCLUDE_RCF_UDPENDPOINT_HPP
19 #define INCLUDE_RCF_UDPENDPOINT_HPP
20 
21 #include <memory>
22 #include <string>
23 
24 #include <RCF/Endpoint.hpp>
25 #include <RCF/Export.hpp>
26 #include <RCF/IpAddress.hpp>
27 
28 namespace RCF {
29 
30  class ServerTransport;
31  class ClientTransport;
32 
34  class RCF_EXPORT UdpEndpoint : public Endpoint
35  {
36  public:
37 
38  // *** SWIG BEGIN ***
39 
41  UdpEndpoint(int port);
42 
44  UdpEndpoint(const std::string &ip, int port);
45 
46  std::string getIp() const;
47  int getPort() const;
48  std::string asString() const;
49 
51  void enableSharedAddressBinding(bool enable = true);
52 
54  void listenOnMulticast(const IpAddress & multicastIp);
55 
57  void listenOnMulticast(const std::string & multicastIp);
58 
59  // *** SWIG END ***
60 
61  UdpEndpoint();
62  UdpEndpoint(const IpAddress & ipAddress);
63  UdpEndpoint(const UdpEndpoint &rhs);
64 
65  std::unique_ptr<ServerTransport> createServerTransport() const;
66  std::unique_ptr<ClientTransport> createClientTransport() const;
67  EndpointPtr clone() const;
68 
69  private:
70  IpAddress mIp;
71  IpAddress mMulticastIp;
72  bool mEnableSharedAddressBinding;
73  };
74 
75 } // namespace RCF
76 
77 #endif // ! INCLUDE_RCF_UDPENDPOINT_HPP
Represents a UDP endpoint.
Definition: UdpEndpoint.hpp:34
std::shared_ptr< Endpoint > EndpointPtr
Reference counted wrapper for RCF::Endpoint.
Definition: RcfFwd.hpp:117
Base class for all network endpoint types.
Definition: Endpoint.hpp:40
Definition: AmiIoHandler.hpp:23
Represents an IP address (IPv4 or IPv6).
Definition: IpAddress.hpp:66