[Plib-cvs] plib/examples/src/net/http_get http_get.cxx,1.3,1.4
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2004-03-21 17:51:23
|
Update of /cvsroot/plib/plib/examples/src/net/http_get In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14241/plib/examples/src/net/http_get Modified Files: http_get.cxx Log Message: Cleaned up some name-space pollution, added readme's for examples. Index: http_get.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/net/http_get/http_get.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- http_get.cxx 21 Mar 2004 17:12:59 -0000 1.3 +++ http_get.cxx 21 Mar 2004 17:41:07 -0000 1.4 @@ -28,33 +28,34 @@ { public: - HTTPClient ( cchar* host, cchar* path ) + HTTPClient ( const char* host, const char* path ) { - open (); - connect (host, 80); + open () ; + connect ( host, 80 ) ; - cchar* s = netFormat ( "GET %s HTTP/1.0\r\n\r\n", path ); - bufferSend( s, strlen(s) ) ; + const char *s = netFormat ( "GET %s HTTP/1.0\r\n\r\n", path ) ; + + bufferSend ( s, strlen(s) ) ; } - virtual void handleBufferRead (netBuffer& buffer) + virtual void handleBufferRead ( netBuffer& buffer ) { - const char* s = buffer.getData(); - while (*s) - fputc(*s++,stdout); + const char* s = buffer.getData () ; + while ( *s ) + fputc ( *s++, stdout ) ; - buffer.remove(); + buffer . remove () ; } } ; -int -main (int argc, char * argv[]) +int main ( int argc, char * argv[] ) { - netInit(&argc,argv); + netInit () ; - new HTTPClient( "www.opengl.org", "/index.html" ); + new HTTPClient ( "plib.sf.net", "/index.html" ) ; - netChannel::loop(0); - return 0; + netChannel::loop ( 0 ) ; + return 0 ; } + |