我在fsock打开时遇到了一些问题,但我是关于套接字的PHP的新手。
我的脚本警告是:
Warning: fsockopen() [function.fsockopen]:
php_network_getaddresses: getaddrinfo failed: No such host is known
这是我的剧本:
foreach($extend as $extra => $serv) {
$buffers = NULL;
if ($socket = fsockopen($serv[0], 43)
/* lets we show system can't connect the server */
or die('error connect servers' . $socket));
fputs($socket, $vers.$extra . "\r\n");
while( !feof($socket) )
{
$buffers .= fgets($socket,128);
}
fclose($socket);