RCFProto
 All Classes Functions Typedefs
UdpEndpoint.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, 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: 2.0
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 <boost/shared_ptr.hpp>
26 
27 #include <RCF/Endpoint.hpp>
28 #include <RCF/Export.hpp>
29 #include <RCF/InitDeinit.hpp>
30 #include <RCF/IpAddress.hpp>
31 #include <RCF/SerializationProtocol.hpp>
32 #include <RCF/TypeTraits.hpp>
33 
34 namespace RCF {
35 
36  class ServerTransport;
37  class ClientTransport;
38 
40  class RCF_EXPORT UdpEndpoint : public Endpoint
41  {
42  public:
43 
44  // *** SWIG BEGIN ***
45 
47  UdpEndpoint(int port);
48 
50  UdpEndpoint(const std::string &ip, int port);
51 
52  std::string getIp() const;
53  int getPort() const;
54  std::string asString() const;
55 
56  UdpEndpoint & enableSharedAddressBinding(bool enable = true);
57  UdpEndpoint & listenOnMulticast(const IpAddress & multicastIp);
58  UdpEndpoint & 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::auto_ptr<ServerTransport> createServerTransport() const;
67  std::auto_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