00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DCPS_RTPSUDPTRANSPORT_H
00009 #define DCPS_RTPSUDPTRANSPORT_H
00010
00011 #include "Rtps_Udp_Export.h"
00012
00013 #include "RtpsUdpDataLink.h"
00014 #include "RtpsUdpDataLink_rch.h"
00015
00016 #include "dds/DCPS/transport/framework/TransportImpl.h"
00017 #include "dds/DCPS/PoolAllocator.h"
00018
00019 #include "dds/DCPS/RTPS/RtpsCoreC.h"
00020
00021 namespace OpenDDS {
00022 namespace DCPS {
00023
00024 class RtpsUdpInst;
00025
00026 class OpenDDS_Rtps_Udp_Export RtpsUdpTransport : public TransportImpl {
00027 public:
00028 explicit RtpsUdpTransport(const TransportInst_rch& inst);
00029
00030 private:
00031 virtual AcceptConnectResult connect_datalink(const RemoteTransport& remote,
00032 const ConnectionAttribs& attribs,
00033 TransportClient* client);
00034
00035 virtual AcceptConnectResult accept_datalink(const RemoteTransport& remote,
00036 const ConnectionAttribs& attribs,
00037 TransportClient* client);
00038
00039 virtual void stop_accepting_or_connecting(TransportClient* client,
00040 const RepoId& remote_id);
00041
00042 virtual bool configure_i(TransportInst* config);
00043
00044 virtual void shutdown_i();
00045
00046 virtual void register_for_reader(const RepoId& participant,
00047 const RepoId& writerid,
00048 const RepoId& readerid,
00049 const TransportLocatorSeq& locators,
00050 OpenDDS::DCPS::DiscoveryListener* listener);
00051
00052 virtual void unregister_for_reader(const RepoId& participant,
00053 const RepoId& writerid,
00054 const RepoId& readerid);
00055
00056 virtual void register_for_writer(const RepoId& ,
00057 const RepoId& ,
00058 const RepoId& ,
00059 const TransportLocatorSeq& ,
00060 DiscoveryListener* );
00061
00062 virtual void unregister_for_writer(const RepoId& ,
00063 const RepoId& ,
00064 const RepoId& );
00065
00066 virtual bool connection_info_i(TransportLocator& info) const;
00067 ACE_INET_Addr get_connection_addr(const TransportBLOB& data,
00068 bool& requires_inline_qos) const;
00069
00070 virtual void release_datalink(DataLink* link);
00071 void pre_detach(TransportClient* client);
00072
00073 virtual OPENDDS_STRING transport_type() const { return "rtps_udp"; }
00074
00075 RtpsUdpDataLink* make_datalink(const GuidPrefix_t& local_prefix);
00076
00077 void use_datalink(const RepoId& local_id,
00078 const RepoId& remote_id,
00079 const TransportBLOB& remote_data,
00080 bool local_reliable, bool remote_reliable,
00081 bool local_durable, bool remote_durable);
00082
00083 RcHandle<RtpsUdpInst> config_i_;
00084
00085
00086 typedef ACE_Thread_Mutex ThreadLockType;
00087 typedef ACE_Guard<ThreadLockType> GuardThreadType;
00088 ThreadLockType links_lock_;
00089
00090
00091
00092 typedef ACE_SYNCH_MUTEX LockType;
00093 typedef ACE_Guard<LockType> GuardType;
00094 LockType connections_lock_;
00095
00096
00097
00098
00099
00100
00101 RtpsUdpDataLink_rch link_;
00102 bool map_ipv4_to_ipv6() const;
00103
00104 ACE_SOCK_Dgram unicast_socket_;
00105
00106 TransportClient* default_listener_;
00107 };
00108
00109 }
00110 }
00111
00112 #endif