Socket GET

Hey,

I'm trying to return a websites (google) html.

I've taken a few hints from the Microsoft winsock examples and come up with this:

 
redacted


It works fine with my HTTP server I also made with Winsock but times out with any real websites.
I think its either the headers, or I'm not sending something correctly that it needs. Though I'm not certain.

Help?

Thanks

tree
Last edited on
Bump with new info.

Ok, turns out I needed:

htmlSend += "\r\n";

on the end, so the headers were wrong. Added it and it worked.

Though I now have a new problem. I'm only receiving a maximum 1460 bytes of data from the server. This happens for all servers I try and connect to.

I've upped the buffer length to 50000 and still no dice. I'm stumped as to what the problem is :/

EDIT: I've just discovered there is a 1460 byte limit for TCP connections. Question is, how do I overcome this?

EDIT2: Can I loop the recv function until the total received bytes = the content-length header?
If so, how can I get the value of it without exploding by "\r\n" and ripping the headers apart with string functions?

tree
Last edited on
Topic archived. No new replies allowed.