I am writing a browser that sends http get requests constructed the same way browsers do. I want to test the "keep-alive" header so I send and receive the following package twice:
"POST /test.php HTTP1.1\r\n" "Host: 192.168.0.1:8000\r\n" "Connection: keep-alive\r\n" "Content-Length: 17\r\n" "Content-Type: application/x-www-form-urlencoded\r\n" "Accept-Language: en-US,en;q=0.8\r\n" "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n" "User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2\r\n" "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" "Referer: http://192.168.0.1:8000/test.php\r\n" "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n" "\r\n\r\n" "para:test_tst_tst"
However, when i receive the second time, I get error 10054 (windows error). It seems as though the server is refusing to send me data.
What this wrong with this?
Connection: close
and do so)? – CodeCaster