![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef APPLICATIONS_SESSION_CLIENT_TLBINDING_HPP 00029 #define APPLICATIONS_SESSION_CLIENT_TLBINDING_HPP 00030 00031 #include <APPLICATIONS/session/Binding.hpp> 00032 00033 #include <WNS/service/nl/Address.hpp> 00034 #include <WNS/service/tl/Service.hpp> 00035 #include <WNS/service/tl/ConnectionHandler.hpp> 00036 #include <WNS/service/tl/PortPool.hpp> 00037 #include <WNS/service/tl/Connection.hpp> 00038 00039 #include <WNS/PyConfigViewCreator.hpp> 00040 #include <WNS/logger/Logger.hpp> 00041 #include <WNS/module/Base.hpp> 00042 00043 00044 namespace applications { namespace session { namespace client { 00045 00046 class TLBinding: 00047 public applications::session::Binding, 00048 public wns::service::tl::ConnectionHandler 00049 { 00050 public: 00051 TLBinding(const wns::pyconfig::View& _pyco); 00052 virtual ~TLBinding(); 00053 00054 // from Binding 00055 virtual void 00056 registerComponent(applications::node::component::Component* _component, int _sessionIndex); 00057 00058 virtual void 00059 initBinding(); 00060 00061 virtual void 00062 releaseBinding(wns::service::tl::Connection* _connection); 00063 00064 virtual void 00065 registerSession(int _i, applications::session::Session* _session); 00066 00067 virtual void 00068 startListening(wns::service::tl::Service* _tlService); 00069 00070 // from ConnectionHandler 00071 virtual void 00072 onConnectionEstablished(wns::service::nl::Address _sourceIpAddress, wns::service::tl::Connection* _newConnection); 00073 00074 virtual void 00075 onConnectionClosed(wns::service::tl::Connection* _connection); 00076 00077 virtual void 00078 onConnectionClosedByPeer(wns::service::tl::Connection* _connection); 00079 00080 virtual void 00081 onConnectionLost(wns::service::tl::Connection* _connection); 00082 00083 protected: 00084 00085 wns::service::tl::Service* tlService;//udpService 00086 00087 wns::service::tl::Port listenPort; 00088 00089 wns::pyconfig::View pyco; 00090 00091 wns::service::nl::FQDN domainName; 00092 00093 wns::service::nl::FQDN destinationDomainName; 00094 00095 wns::service::tl::Port destinationPort; 00096 00097 applications::session::Session* session; 00098 00099 wns::service::qos::QoSClass qosClass; 00100 00101 virtual std::string printAddress() const; 00102 00106 wns::logger::Logger logger; 00107 00108 }; 00109 00110 typedef wns::SmartPtr<TLBinding> TLBindingPtr; 00111 00112 } // namespace client 00113 } // namespace session 00114 } // namespace applications 00115 00116 #endif // APPLICATIONS_SESSION_CLIENT_TLBINDING_HPP
1.5.5