|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-16 21:41 UTC] jason at eblasterpro dot com
Description:
------------
I passed this option
$options = array('socket' => array('bindto' => '10.1.14.1:9000'));
into
$context = stream_context_create($options);
$fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context);
Which caused my program to stop connecting all together.
The ip and port are valid.
Expected result:
----------------
Pear Socket.php has a place for options to be passed in, so I thought it would bind
Actual result:
--------------
Could never connect to remote machine
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 10:00:01 2025 UTC |
<b>Warning</b>: fsockopen() expects at most 5 parameters, 6 given in <b>/home/home/virtualhosts/trendex/lib/Net/Socket4.php</b> on line <b>133</b><br /> Pear's Socket.php contain the following in its connect function. The must have wrote this assuming fsockopen would accept options one day. $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen'; $errno = 0; $errstr = ''; if ($options && function_exists('stream_context_create')) { if ($this->timeout) { $timeout = $this->timeout; } else { $timeout = 0; } $context = stream_context_create($options); $fp = $openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context); } else { if ($this->timeout) { $fp = $openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout); } else { $fp = $openfunc($this->addr, $this->port, $errno, $errstr); } }