|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-29 23:56 UTC] fhoenig at kargo dot com
[2008-04-30 08:48 UTC] jani@php.net
[2008-04-30 16:16 UTC] fhoenig at kargo dot com
[2008-04-30 16:43 UTC] fhoenig at kargo dot com
[2008-05-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ The below code only works with sleeping in between stream_socket_client() and the first IO on the socket. No error though. Works on FreeBSD 6.2 and linux as well as OSX. Just not on Freebsd 7.0. was installed through ports with default options. What changed in freebsd 7 that could cause that? Fix through sysctl option maybe? Reproduce code: --------------- $fp = stream_socket_client("tcp://www.google.com:80", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); //sleep(1); <=== works only with sleep uncommented. if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { fwrite($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n"); while (!feof($fp)) { echo fgets($fp, 1024); } fclose($fp); } Expected result: ---------------- The html output from www.google.com/ Actual result: -------------- Locks up after fwrite and never reads anything from the socket. No error.