Bug #49200 [Opn->Bgs]: stream bindto context generates an error

From: Date: Tue, 18 May 2010 08:11:36 +0000
Subject: Bug #49200 [Opn->Bgs]: stream bindto context generates an error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150542@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=49200&edit=1

 ID:               49200
 Updated by:       mike@php.net
 Reported by:      jeremy at ssnet dot ca
 Summary:          stream bindto context generates an error
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Streams related
 Operating System: FreeBSD 7.2-STABLE
 PHP Version:      6SVN-2009-08-09 (SVN)

 New Comment:

Not reproducible, I get

Warning: file_get_contents(http://php.net): failed to open stream:
Invalid argument

unless I specify an IP address connected to the outside world.


Previous Comments:
------------------------------------------------------------------------
[2009-08-09 09:40:08] jeremy at ssnet dot ca

Description:
------------
Specifying any IP address for bindto in stream_context_set_option()
produces an error "(local_addr context option is not a string.)"

Reproduce code:
---------------
$context = stream_context_create ();
stream_context_set_option ($context, 'socket', 'bindto',
'127.0.0.1:0');
$contents = file_get_contents ("http://php.net",
FALSE, $context);

Expected result:
----------------
Should return the contents of php.net

Actual result:
--------------
Warning: file_get_contents(http://php.net/): failed to open stream:
local_addr context option is not a string.


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=49200&edit=1


Thread (2 messages)

« previous php.bugs (#150542) next »