Re: Socket takes a long time to 'finish'
| From: | Alvar Saenz-Otero | Date: | Wed, 29 Aug 2007 14:33:53 +0000 |
| Subject: | Re: Socket takes a long time to 'finish' | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261453@lists.php.net to get a copy of this message | ||
Thank you! Either of the two options fixed it! My guess is that HTTP 1.0 does not need the "Connection: close" while HTTP 1.1 does. So I had to fix one of the two... I did both, just so that my script has better compatibility in the future.
Thanks again,
Alvar
At 06:59 2007/08/29, Eddie Dunckley wrote:
On Wed 29 Aug 07, Alvar Saenz-Otero wrote: Hello, I have a small but somewhat annoying issue. Whenever I open a socket to another server, the file is read very quickly, but it takes the up to 30 seconds or so to close the connection... Here is what I do: $sever = "server.mit.edu"; $url = "/link"; $port = 80; $user_agent = $_SERVER['HTTP_USER_AGENT']; $server_protocol = $_SERVER['SERVER_PROTOCOL']; just a wild guess, but try to use perhaps http1.0 instead of 1.1, and try to add into the header that you prepare and send a Connection: close\r\n -- Eddie Dunckley - eddie@rttc.co.za - Realtime Travel Connections IBE Development, www.rttc.co.za, cell 083-379-6891, fax 086-617-7831 Where 33deg53'37.23"S 18deg37'57.87"E Cape Town Bellville Oakdale ZA================================================================= Alvar Saenz Otero, PhD MIT Space Systems Laboratory 617.699.7311 cell alvarso@mit.edu"I used to have a handle on life, but it broke."