User Manual, Developers Guide and API Documentation

TcpBinding.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. 16, 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 CONSTANZE_TCPBINDING_HPP
00029 #define CONSTANZE_TCPBINDING_HPP
00030 
00031 #include <CONSTANZE/Binding.hpp>
00032 #include <CONSTANZE/Generator.hpp>
00033 
00034 #include <WNS/service/nl/Address.hpp>
00035 #include <WNS/service/tl/Service.hpp>
00036 #include <WNS/service/tl/ConnectionHandler.hpp>
00037 #include <WNS/service/tl/DataHandler.hpp>
00038 #include <WNS/service/tl/PortPool.hpp>
00039 #include <WNS/service/tl/Connection.hpp>
00040 
00041 #include <WNS/PyConfigViewCreator.hpp>
00042 #include <WNS/logger/Logger.hpp>
00043 #include <WNS/module/Base.hpp>
00044 
00045 
00046 namespace constanze
00047 {
00048     class TcpBinding:
00049         public Binding,
00050         public wns::service::tl::ConnectionHandler
00051     {
00052     public:
00053         TcpBinding(const wns::pyconfig::View& _pyco);
00054         virtual ~TcpBinding() {};
00055 
00056         // from Binding
00057         virtual void
00058         registerComponent(wns::node::component::Component* _component);
00059 
00060         virtual void
00061         sendData(const wns::osi::PDUPtr& _data);
00062 
00063         virtual void
00064         initBinding(constanze::StartTrigger* _startTrigger);
00065 
00066         virtual void
00067         releaseBinding(constanze::StopTrigger* _stopTrigger);
00068 
00069         virtual void
00070         registerListener(constanze::Listener* _listener);
00071 
00072         // from ConnectionHandler
00073         virtual void
00074         onConnectionEstablished(wns::service::nl::Address _sourceIpAddress, wns::service::tl::Connection* _newConnection);
00075 
00076         virtual void
00077         onConnectionClosed(wns::service::tl::Connection* _connection);
00078 
00079         virtual void
00080         onConnectionClosedByPeer(wns::service::tl::Connection* _connection);
00081 
00082         virtual void
00083         onConnectionLost(wns::service::tl::Connection* _connection);
00084 
00085     protected:
00086         constanze::StartTrigger* startTrigger;
00087 
00088         constanze::StopTrigger* stopTrigger;
00089 
00090         wns::service::tl::Service* tcpService;
00091 
00092         wns::service::tl::ConnectionHandler* connectionHandler;
00093 
00094         wns::service::tl::Connection* connection;
00095 
00096         wns::node::component::Component* component;
00097 
00098         wns::pyconfig::View pyco;
00099 
00100         wns::service::nl::FQDN domainName;
00101 
00102         wns::service::nl::FQDN destinationDomainName;
00103 
00104         wns::service::tl::Port destinationPort;
00105 
00106         wns::service::qos::QoSClass qosClass;
00107 
00108         virtual std::string
00109         printAddress() const;
00110 
00114         wns::logger::Logger log;
00115     };
00116 } //constanze
00117 
00118 #endif

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