0
我試圖發送很多post-requests到localhost:80
(nginx-server)。POST請求和nginx
我送的標題是:
POST /LINK HTTP/1.1
User-Agent: User agent
Host: localhost
Accept: */*
Connection: Keep-Alive
Content-Type: application/octet-stream
Content-Length: 16
DATA 16 BYTES
僞代碼:
TCPSocket sock('localhost', 80);
for(;;) {
sock.sendPost();
}
sock.close();
但服務器返回第一時間:
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 16 Apr 2012 14:54:26 GMT
Content-Type: application/json
Content-Length: 92
Connection: close
ANSWER 92 BYTES
所以服務器不與週期的所有其他請求一起工作。
爲什麼不Connection: Keep-Alive
工作和服務器返回Connection: close
?
他們是正確的。問題是服務器不關心我的頭,反正關閉連接。 – Ockonal 2012-04-16 18:52:01