Re: Socket_Connect returning unusual error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Hubscher wrote:
> Warning: socket_connect() expects parameter 3 to be long, string given
> in testing.php on line 21
> Couldn't Create Socket: Success

PHP usually auto-converts data -- However it's possible that this
EXPERIMENTAL function (?) doesn't have the magic code down in the guts of
PHP.

So, try type-casting your third parameter to an (int):


>      $currport = $servers[$key]['Port']; // was attempting this to see

$currport = (int) $servers[$key]['Port'];

echo "currport is: '$currport'<br />\n";


If this fixes it, file a bug report at http://bugs.php.net -- search for
the same issue first.  It should get fixed pretty quick-like (relatively
speaking) if that's all it is.

It's also possible that your 'Port' is empty or something...  That's why I
included the 'echo' -- Always hand-check the data you are sending when
weird things happen.

One line of debugging output can save hours of time and fistfuls of hair.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux