User Manual, Developers Guide and API Documentation

TcpServerBinding.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * TCP Binding                                                                *
00003  * __________________________________________________________________________ *
00004  *                                                                            *
00005  * Copyright (C) 2005                                                         *
00006  * Lehrstuhl fuer Kommunikationsnetze (ComNets)                               *
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany                                 *
00008  * phone: ++49-241-80-27910 (phone), fax: ++49-241-80-22242                   *
00009  * email: wns@comnetsrwth-aachen.de, www: http://wns.comnets.rwth-aachen.de/  *
00010  ******************************************************************************/
00011 
00012 #ifndef CONSTANZE_TCPSERVERBINDING_HPP
00013 #define CONSTANZE_TCPSERVERBINDING_HPP
00014 
00015 #include <CONSTANZE/Binding.hpp>
00016 #include <CONSTANZE/Generator.hpp>
00017 
00018 #include <WNS/service/nl/Service.hpp>
00019 #include <WNS/service/nl/Address.hpp>
00020 #include <WNS/service/tl/Service.hpp>
00021 #include <WNS/service/tl/ConnectionHandler.hpp>
00022 #include <WNS/service/tl/DataHandler.hpp>
00023 #include <WNS/service/tl/PortPool.hpp>
00024 #include <WNS/service/tl/Connection.hpp>
00025 
00026 #include <WNS/logger/Logger.hpp>
00027 #include <WNS/module/Base.hpp>
00028 
00029 
00030 namespace constanze
00031 {
00032     class TcpServerBinding:
00033         public Binding,
00034         public wns::service::tl::ConnectionHandler
00035     {
00036     public:
00037         TcpServerBinding(wns::service::nl::Address _address, wns::service::tl::Connection* _connection, wns::logger::Logger& logger);
00038         virtual ~TcpServerBinding() {};
00039 
00040 
00041         // from Binding
00042         virtual void
00043         registerComponent(wns::node::component::Component* _component);
00044 
00045         virtual void
00046         sendData(const wns::osi::PDUPtr& _data);
00047 
00048         virtual void
00049         initBinding(constanze::StartTrigger* _startTrigger);
00050 
00051         virtual void
00052         releaseBinding(constanze::StopTrigger* _stopTrigger);
00053 
00054         virtual void
00055         registerListener(constanze::Listener* _listener);
00056 
00057         // from ConnectionHandler
00058         virtual void
00059         onConnectionEstablished(wns::service::nl::Address _sourceIpAddress, wns::service::tl::Connection* _newConnection);
00060 
00061         virtual void
00062         onConnectionClosed(wns::service::tl::Connection* _connection);
00063 
00064         virtual void
00065         onConnectionClosedByPeer(wns::service::tl::Connection* _connection);
00066 
00067         virtual void
00068         onConnectionLost(wns::service::tl::Connection* _connection);
00069 
00070     protected:
00071         constanze::StartTrigger* startTrigger;
00072         constanze::StopTrigger* stopTrigger;
00073         //wns::service::tl::Service* tcpService;
00074 
00075         wns::service::tl::ConnectionHandler* connectionHandler;
00076 
00077         wns::node::component::Component* component;
00078 
00079         //wns::service::nl::FQDN domainName;
00080         //wns::service::nl::FQDN destinationDomainName;
00081         //wns::service::tl::Port destinationPort;
00082 
00083         virtual std::string
00084         printAddress() const;
00085 
00087         wns::logger::Logger log;
00088     private:
00090         wns::service::nl::DNSService* dns;
00091         wns::service::nl::Address peerAddress;
00092         wns::service::tl::Connection* connection;
00093     };
00094 } //constanze
00095 
00096 #endif

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