| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2003 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: twopointconnectionimpl.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // $Date: 2007-08-09 09:51:16 +0200 (Thu, 09 Aug 2007) $ 00020 // $Revision: 6014 $ 00021 // $State$ 00022 // $Author: Konstantin_Baumann $ 00023 // 00024 // $Log$ 00025 // Revision 1.1 2003/11/27 09:29:41 kirsch 00026 // moved impl-header to include directory for consistent makefile rules 00027 // 00028 // Revision 1.2 2003/11/15 00:54:00 buchholz 00029 // socket signals are disconnected in the destructor 00030 // 00031 // Revision 1.1 2003/11/13 12:23:26 kirsch 00032 // converted filenames to lowercase 00033 // 00034 // Revision 1.1 2003/11/12 11:42:02 buchholz 00035 // first checkin of the vrs-qt-network classes 00036 // 00037 00038 #include <qsocket.h> 00039 #include <qserversocket.h> 00040 #include <qstring.h> 00041 #include <vrs/qt3/twopointconnection.h> 00042 00043 namespace VRS { 00044 00045 class TwoPointConnection::ImplClient : public QObject { 00046 Q_OBJECT 00047 00048 public: 00049 00050 ImplClient(int socket, std::deque<VRS::UINT8>* buffer, TwoPointConnection* parent); 00051 ImplClient(std::string host, int port, std::deque<VRS::UINT8>* buffer, TwoPointConnection* parent); 00052 virtual ~ImplClient(); 00053 void sendBuffer(std::vector<VRS::UINT8>& buffer); 00054 bool connected() const; 00055 00056 00057 private slots: 00058 00059 void onConnect(); 00060 void onReceive(); 00061 void onDisconnect(); 00062 void onError(int); 00063 00064 private: 00065 QSocket* socket_; 00066 std::deque<VRS::UINT8>* buffer_; 00067 TwoPointConnection* parent_; 00068 }; 00069 00070 class TwoPointConnection::ImplServer : public QServerSocket { 00071 Q_OBJECT 00072 00073 public: 00074 ImplServer(int port, ImplClient** clientPtr, std::deque<VRS::UINT8>* buffer, TwoPointConnection* parent); 00075 00076 private: 00077 virtual void newConnection(int socket); 00078 00079 ImplClient** clientPtr_; 00080 std::deque<VRS::UINT8>* buffer_; 00081 TwoPointConnection* parent_; 00082 }; 00083 00084 } 00085 00086 00087