Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src
In directory sc8-pr-cvs1:/tmp/cvs-serv7723/src
Modified Files:
Main.cpp
Log Message:
30/12/2003 Mikael Barbeaux
* Implemented a Http processor thread object.
* Implemented a Http connections manager object.
* Modified configure script for pthread library.
Index: Main.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/Main.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Main.cpp 26 Dec 2003 22:56:43 -0000 1.7
+++ Main.cpp 30 Dec 2003 10:45:11 -0000 1.8
@@ -22,6 +22,7 @@
#include "test/TestSemaphore.h"
#include "test/TestSocket.h"
#include "test/TestHttpSocket.h"
+#include "test/TestHttpManager.h"
#include <iostream>
#include <string>
using namespace std;
@@ -30,12 +31,23 @@
* Main program.
*/
int main() {
+ #ifdef _WIN32_
+ // Init WINSOCK
+ WORD winsockminversion = MAKEWORD(2,0);
+ WSADATA wsaData;
+ int WSockStatus = WSAStartup(winsockminversion, &wsaData);
+ if(WSockStatus != 0) {
+ cout << "ERROR_WINSOCK" << std::endl;
+ return -1;
+ }
+ #endif
+
cout << "Choose a test to run : " << endl;
cout << " 1. Exceptions test" << endl;
cout << " 2. Threads test" << endl;
cout << " 3. Semaphores test" << endl;
cout << " 4. Generic Sockets test" << endl;
- cout << " 5. HTTP sockets test" << endl;
+ cout << " 5. HTTP Manager test" << endl;
cout << "Enter your choice : ";
bool cont = true;
@@ -62,33 +74,13 @@
cont = false;
}
else if(command == "4") {
- #ifdef _WIN32_
- // Init WINSOCK
- WORD winsockminversion = MAKEWORD(2,0);
- WSADATA wsaData;
- int WSockStatus = WSAStartup(winsockminversion, &wsaData);
- if(WSockStatus != 0) {
- cout << "ERROR_WINSOCK" << std::endl;
- return -1;
- }
- #endif
TestSocket test_sock;
test_sock.test();
cont = false;
}
else if(command == "5") {
- #ifdef _WIN32_
- // Init WINSOCK
- WORD winsockminversion = MAKEWORD(2,0);
- WSADATA wsaData;
- int WSockStatus = WSAStartup(winsockminversion, &wsaData);
- if(WSockStatus != 0) {
- cout << "ERROR_WINSOCK" << std::endl;
- return -1;
- }
- #endif
- TestHttpSocket test_http;
- test_http.test();
+ TestHttpManager test_httpman;
+ test_httpman.test();
cont = false;
}
else cout << "Invalid choice... Enter your choice : ";
|