note 101838 rejected from function.pfsockopen by danbrown
| From: | danbrown@php.net | Date: | Thu, 13 Jan 2011 16:09:17 +0000 |
| Subject: | note 101838 rejected from function.pfsockopen by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175716@lists.php.net to get a copy of this message | ||
Note Submitter: donald at ddj dot co dot za
----
I am trying to figure out how the locking / synchronization works on pfsockopen, if there is even
any?
Example is:
$fp = pfsockopen("myhost.com", 80, $errno, $errstr);
fwrite($fp, "MyRequest1");
$data = fread($fp, 8192); /* Server should now spend specific answer */
What if your server is very heavily loaded, and another script calls pfsockopen() and its own
fwrite() on the same host/port between the fwrite and the fread of the currently executing script?
Would this then cause incorrect information in the data read (out of sync?) or does PHP have some
sort of protection against this.
Thanks,
Donald