KjServerTest.h

Go to the documentation of this file.
00001 
00013 /***************************************************************************
00014  *   Copyright (C) 2007 by Jan Koci   *
00015  *   honza.koci@email.cz   *
00016  *   http://kengine.sourceforge.net/tutorial/
00017  *                                                                         *
00018  *   This program is free software; you can redistribute it and/or modify  *
00019  *   it under the terms of the GNU General Public License as published by  *
00020  *   the Free Software Foundation; either version 2 of the License, or     *
00021  *   (at your option) any later version.                                   *
00022  *                                                                         *
00023  *   This program is distributed in the hope that it will be useful,       *
00024  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00025  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00026  *   GNU General Public License for more details.                          *
00027  *                                                                         *
00028  *   You should have received a copy of the GNU General Public License     *
00029  *   along with this program; if not, write to the                         *
00030  *   Free Software Foundation, Inc.,                                       *
00031  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00032  ***************************************************************************/
00033 
00034 // Generate doxygen main page
00055 #pragma once
00056 
00057 
00058 #include <vector>
00059 #include <iostream>
00060 using namespace std;
00061 
00062 #ifdef do_open
00063 #undef do_open
00064 #endif
00065 
00066 #ifdef do_close
00067 #undef do_close
00068 #endif
00069 
00070 
00071 #include "../../KjSslSocket/KjDefines.h"
00072 #include "../../KjSslSocket/KjSslServer.h"
00073 #include "../../KjSslSocket/KjSslConnection.h"
00074 #include "../../KjSslSocket/KjSignal.h"
00075 #include "../../KjSslServer/KjServerThread.h"
00076 
00077 
00078 class KjServerTest
00079 {
00080 private:
00081         KjServerThread *m_pServer;
00082         string m_strReadMsg;            
00083         string m_strWriteMsg;           
00084         bool m_bIsConnected;            
00085 
00086         bool CanRead(const int _iClientId);
00087         const char *Read(const int _iClientId);
00088         void Write(const int _iClientId, const char* _strMsg);
00089         int GetNumClients();
00090         void Connect(char* _strConn, const char* _strCertFile,const char* _strKeyFile);
00091         int Start();
00092         static void *NewThread(void *_pArg);
00093         void CreateNewThread();
00094         void ConnectServer();
00095 public:
00096         KjServerTest();
00097         ~KjServerTest();
00098 
00099         int Update();
00100 };
00101 

Generated on Tue Jul 24 10:03:56 2007 for Servertest by  doxygen 1.4.6