Ok... can you try the following:
Create a file in server/base/site/tests called something like tcpdebug.php and in it put the code at the bottom of this post (n.b. you can do this with the file manager if you chmod 777 the directory).
Then set the system variable (Configuration - System Settings - System Variables) site.include.tests to 1 (it should be there set to 0).
Now... in the system info page you should see TCP Debug.
Add a TCP Debug test to your test node and run it again from the command-line. This should show if something is going wrong with the config being passed down or with the actual connection.
Cheers,
Dave.
Code for server/base/site/tests/tcpdebug.php:
Code: Select all
<?php // tcpdebug.php -- Debug TCP test module
global $NATS;
if (isset($NATS))
{
class FreeNATS_TCP_Debug extends FreeNATS_Local_Test
{
function DoTest($testname,$param,$hostname,$timeout,$params)
{
echo "Called for ".$hostname." port ".$param." timeout ".$timeout."\n";
$timer=new TFNTimer();
$ip=ip_lookup($hostname);
echo $hostname." => ".$ip."\n";
if ($ip=="0") return -2; // lookup failed
echo "Lookup Successful\n";
$errno=0;
$errstr="";
$timer->Start();
echo "Doing fsockopen()\n";
$fp=fsockopen($ip,$param,$errno,$errstr,$timeout);
$elapsed=$timer->Stop();
echo "FP is : ";
echo $fp;
echo "\n";
if ($fp===false) return -1; // open failed
echo "Closing\n";
@fclose($fp);
return $elapsed;
}
function Evaluate($result)
{
if ($result<0) return 2; // failure
return 0; // else success
}
function DisplayForm(&$row)
{
echo "<table border=0>";
echo "<tr><td align=left>";
echo "TCP Port :";
echo "</td><td align=left>";
echo "<input type=text name=testparam size=30 maxlength=128 value=\"".$row['testparam']."\">";
echo "</td></tr>";
echo "</table>";
}
}
$params=array();
$NATS->Tests->Register("tcpdebug","FreeNATS_TCP_Debug",$params,"TCP Debug Connect",1,"FreeNATS TCP Debug");
$NATS->Tests->SetUnits("tcpdebug","Seconds","s");
}
?>