From: <mik...@us...> - 2003-12-26 22:56:46
|
Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src In directory sc8-pr-cvs1:/tmp/cvs-serv3848/src Modified Files: Main.cpp Log Message: 26/12/2003 Mikael Barbeaux * Added a test program for Http sockets. * Fixed a problem about accepting sockets which were an infinite process. * Implemented main http controls : HttpRequest, HttpResponse, HttpSocket, HttpServerSocket and Writers Index: Main.cpp =================================================================== RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/Main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Main.cpp 26 Dec 2003 10:33:47 -0000 1.6 +++ Main.cpp 26 Dec 2003 22:56:43 -0000 1.7 @@ -21,6 +21,7 @@ #include "test/TestThread.h" #include "test/TestSemaphore.h" #include "test/TestSocket.h" +#include "test/TestHttpSocket.h" #include <iostream> #include <string> using namespace std; @@ -33,7 +34,8 @@ cout << " 1. Exceptions test" << endl; cout << " 2. Threads test" << endl; cout << " 3. Semaphores test" << endl; - cout << " 4. Sockets test" << endl; + cout << " 4. Generic Sockets test" << endl; + cout << " 5. HTTP sockets test" << endl; cout << "Enter your choice : "; bool cont = true; @@ -72,6 +74,21 @@ #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(); cont = false; } else cout << "Invalid choice... Enter your choice : "; |