00001 00013 // Generate doxygen main page 00035 #pragma once 00036 00037 // The following command generates a 1024 bit RSA private key and a certificate request: 00038 // openssl req -newkey rsa:1024 -keyout test.key -out test.crt 00039 // The following command generates a 1024 bit RSA private key and a certificate request that expires after 365 days: 00040 // openssl req -newkey rsa:1024 -keyout test.key -nodes -days 365 -out test.crt 00041 00042 #include <sstream> 00043 #include <vector> 00044 using namespace std; 00045 #include <sys/wait.h> 00046 #include <sys/stat.h> // mkfifo 00047 #include <sys/file.h> // O_RDONLY, O_WRONLY 00048 00049 #include "../KjSslSocket/KjSslServer.h" 00050 #include "../KjSslSocket/KjDefines.h" 00051 #include "../KjSslSocket/KjSignal.h" 00052 #include "K3dString.h" 00053 #include <pthread.h> // For threads 00054 using namespace K3d; 00055 #include "KjClientConn.h" 00056 00068 typedef std::vector<KjClientConn*> TClientArray; 00069 00070 class KjServerThread: public K3dString 00071 { 00072 KjSslServer *m_pServer; 00073 KjSignal *m_pSignal; 00074 TClientArray m_tClientArray; 00075 bool m_bIsNewClientConn; 00076 pthread_t *m_pThread; 00077 00078 static void *NewThread(void *_pArg); 00079 void *ms_pObject; 00080 void CreateNewThread(); 00081 00082 public: 00083 KjServerThread(char* _strConn, const char* _strCertFile,const char* _strKeyFile); 00084 ~KjServerThread(); 00085 00086 int GetNumClients(); 00087 KjClientConn *GetClient(const int _iClientId); 00088 int Start(); 00089 };