Update of /cvsroot/sharedaemon/sharedaemon-ui-web/src/test
In directory sc8-pr-cvs1:/tmp/cvs-serv24081/src/test
Modified Files:
TestSocket.cpp
Log Message:
27/12/2003 Mikael Barbeaux
* Fixed a bug about accepting sockets and closing server.
Index: TestSocket.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/sharedaemon-ui-web/src/test/TestSocket.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- TestSocket.cpp 26 Dec 2003 22:56:42 -0000 1.2
+++ TestSocket.cpp 27 Dec 2003 10:27:09 -0000 1.3
@@ -57,13 +57,15 @@
cout << "Validates the server socket..." << endl;
server.validate();
cout << "Bind server socket on port 4589..." << endl;
- server.bind(4589);
+ server.bind(8523);
cout << "Listening for connections..." << endl;
server.listen(5);
cout << "Take your browser to test \"http://localhost:4589\"..." << endl;
Socket *socket = server.accept();
+ if(socket == 0)
+ cout << "socket null" << endl;
cout << "Socket accepted !" << endl;
- char *recv;
+ char *recv = new char;
socket->receive(&recv);
cout << "Reveiced mesage : " << endl;
cout << recv << endl;
|