1
如何从使用PHP的telnet会话断开连接?使用下面的代码我读取了telnet输出。但是如果数据无法在$输出变量中接收,我想断开与telnet会话的连接在3秒内。我如何做到这一点。请看我的代码如下:如何使用PHP超时telnet会话
$fp = fsockopen("localhost", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET/HTTP/1.1\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$output=fread($fp,128);//Here we read the output value from socket
fclose($fp);
echo $output;
}
thanks..im system.Couldü请指南我如何创建循环,并设置时间差异??请指导和帮助.. – riad 2011-05-26 07:22:34
谢谢它的工作.... – riad 2011-05-26 08:13:19