Socket_Connect returning unusual error

From: Date: Sun, 16 Jan 2005 22:51:13 +0000
Subject: Socket_Connect returning unusual error
Groups: php.general 
Request: Send a blank email to php-general+get-206490@lists.php.net to get a copy of this message
Warning: socket_connect() expects parameter 3 to be long, string given in testing.php on line 21 Couldn't Create Socket: Success It actually spits that across for every socket I'm trying to connect. I'm doing an online status for multiple servers, which I have tested to work when I simply do a socket_connect($sock,$url,$port); on the port numbers of the various servers. The servers all reside on the same IP address. The script actually works manually, ie if i put the actual port in to the socket_connect function call. However, as soon as I put the variable in - it wont work. The code looks like so: foreach ($servers as $key => $value){
    $currport = $servers[$key]['Port']; // was attempting this to see if it would work - it did not either. Normally tried $servers[$key]['Port'] directly.
    if(!socket_connect($sock, $ip, $currport)){
        print("Couldn't Create Socket: " . socket_strerror(socket_last_error()). "\n"); // Debugging purposes
        $output .= "Server Name: " . $Servers[$key]['Name']. " ~~ Offline <br />";
    }
    else{
        $output .= "Server Name: " . $Servers[$key]['Name']. " ~~ Online <br />";
    }
} I cant quite find anything that is... actually wrong with the code. I dont understand the error all that much either, as it says "Success" in it. Needless to say - I'm thoroughly confused! Anyone help me out? Thanks!

« previous php.general (#206490) next »