ipv6_tcp.h

00001 /***************************************************************************
00002 *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003 *   rvinyard@cs.nmsu.edu                                                  *
00004 *                                                                         *
00005 *   This program is free software; you can redistribute it and/or modify  *
00006 *   it under the terms of the GNU Lesser General Public License as        *
00007 *   published by the Free Software Foundation version 2.1.                *
00008 *                                                                         *
00009 *   This program is distributed in the hope that it will be useful,       *
00010 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012 *   GNU General Public License for more details.                          *
00013 *                                                                         *
00014 *   You should have received a copy of the GNU Lesser General Public      *
00015 *   License along with this library; if not, write to the                 *
00016 *   Free Software Foundation, Inc.,                                       *
00017 *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018 ***************************************************************************/
00019 #ifndef CONEXUS_IPV6TCP_H
00020 #define CONEXUS_IPV6TCP_H
00021 
00022 #include <boost/shared_ptr.hpp>
00023 
00024 #include <conexus/ipv6_ip.h>
00025 
00030 namespace Conexus
00031   {
00032 
00033   namespace IPv6
00034     {
00035 
00042     class TCP : public IP
00043       {
00044       public:
00045         friend class TCPServer;
00046 
00047         typedef boost::shared_ptr<TCP> pointer;
00048 
00049         TCP(uint16_t port=0);
00050 
00051         static TCP::pointer create(uint16_t port=0);
00052 
00053         virtual ~TCP() throw();
00054 
00059         int pending_input_size();
00060 
00064         int pending_output_size();
00065 
00070         virtual ssize_t write(const void* data, size_t size) throw (write_error);
00071 
00078         virtual Data read(size_t s = -1)  throw (read_error);
00079 
00080         virtual void connect() throw (connect_error);
00081         virtual void connect(Address& a) throw (connect_error)
00082         {
00083           Socket::connect(a);
00084         }
00085         
00086         virtual const std::string& object_type() { static std::string s("Conexus::IPv6::TCP"); return s; }
00087 
00088       protected:
00089 
00094         TCP(int accepted_fd, bool);
00095 
00096         static TCP::pointer create(int accepted_fd, bool);
00097 
00098         virtual void on_local_interface_changed(unsigned which);
00099         virtual void on_remote_address_changed(unsigned which);
00100       };
00101 
00102   }
00103 
00104 }
00105 
00106 #endif

Generated on Sun Aug 6 12:16:57 2006 by  doxygen 1.4.6