User Manual, Developers Guide and API Documentation

TLListenerBinding.hpp

Go to the documentation of this file.
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_SERVER_TLLISTENERBINDING_HPP
00029 #define APPLICATIONS_SESSION_SERVER_TLLISTENERBINDING_HPP
00030 
00031 #include <APPLICATIONS/session/Binding.hpp>
00032 
00033 #include <WNS/service/nl/Address.hpp>
00034 #include <WNS/service/tl/ConnectionHandler.hpp>
00035 #include <WNS/service/tl/Connection.hpp>
00036 #include <WNS/service/tl/PortPool.hpp>
00037 
00038 #include <WNS/PyConfigViewCreator.hpp>
00039 #include <WNS/logger/Logger.hpp>
00040 #include <WNS/module/Base.hpp>
00041 
00042 
00043 namespace applications { namespace session { namespace server {
00044 
00045       class TLListenerBinding:
00046     public applications::session::Binding,
00047     public wns::service::tl::ConnectionHandler
00048       {
00049       public:
00050     TLListenerBinding(const wns::pyconfig::View& _pyco);
00051     virtual ~TLListenerBinding();
00052 
00053     // from Binding
00054     virtual void
00055     registerSession(int _i, applications::session::Session* _session);
00056 
00057     virtual void
00058     registerComponent(applications::node::component::Component* _component, int _sessionIndex);
00059 
00060     virtual void
00061     initBinding();
00062 
00063     virtual void
00064     releaseBinding(wns::service::tl::Connection* _connection);
00065 
00066     // from ConnectionHandler
00067     virtual void
00068     onConnectionEstablished(wns::service::nl::Address _sourceIpAddress,
00069                 wns::service::tl::Connection* _newConnection);
00070 
00071     virtual void
00072     onConnectionClosed(wns::service::tl::Connection* _connection);
00073 
00074     virtual void
00075     onConnectionClosedByPeer(wns::service::tl::Connection* _connection);
00076 
00077     virtual void
00078     onConnectionLost(wns::service::tl::Connection* _connection);
00079 
00080     virtual void
00081     onShutdown();
00082 
00083     typedef std::map<int, applications::session::Session*> mapType;
00084     mapType sessionMap;
00085 
00086       protected:
00087     applications::node::component::Component* component;
00088 
00089     wns::service::tl::Service* tlService;
00090 
00091     wns::pyconfig::View pyco;
00092 
00093     wns::service::nl::Address ownAddress;
00094 
00095     wns::service::tl::Port listenPort;
00096 
00097     wns::service::nl::FQDN domainName;
00098 
00099     wns::service::nl::FQDN destinationDomainName;
00100 
00101     wns::service::tl::Port destinationPort;
00102 
00103     wns::service::qos::QoSClass qosClass;
00104 
00105     int sessionIndex;
00106 
00110     wns::logger::Logger logger;
00111 
00112     virtual std::string printAddress() const;
00113 
00114       };
00115 
00116       typedef wns::SmartPtr<TLListenerBinding> TLListenerBindingPtr;
00117 
00118     } // namespace server
00119   } // namespace session
00120 } // namespace applications
00121 
00122 #endif // APPLICATIONS_SESSION_SERVER_TLLISTENERBINDING_HPP

Generated on Sat May 26 03:32:14 2012 for openWNS by  doxygen 1.5.5