#123407 - Lick - Tue Mar 27, 2007 11:21 pm
I just want to say I just successfully ported libxpnet's nsSocket.h and nsSocket.cpp to DS. Following will be nsHTTPConn.h and nsHTTPConn.cpp.
I'm reasonably happy, since the following code is needed to fetch a webpage:
When nsHTTPConn and nsFTPConn are done, I will release the port.
- Lick
_________________
http://licklick.wordpress.com
I'm reasonably happy, since the following code is needed to fetch a webpage:
Code: |
nsSocket *sock = new nsSocket("www.google.com", 80);
sock->Open(); char fetch[] = "GET / HTTP/1.1\r\n" "Host: www.google.com\r\n" "User-Agent: NintendoDS\r\n\r\n"; int size = strlen(fetch); sock->Send((unsigned char*)fetch, &size); char data[2048] = {0}; size = 2048; sock->Recv((unsigned char*)data, &size); sock->Close(); iprintf(data); |
When nsHTTPConn and nsFTPConn are done, I will release the port.
- Lick
_________________
http://licklick.wordpress.com