2年前它工作了,现在发射了一些annyoing错误什么我找不到它的答案为什么它不工作:
$this->BotSocket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
if (!$this->BotSocket) {
die('Socket error1 : '.socket_strerror(socket_last_error()));
}
/**
* Bind the socket to make it irc'able
*/
if(!socket_bind($this->BotSocket, $this->BotConfig['hostname'])) {
die('Socket error2 : '.socket_strerror(socket_last_error()));
}
if(!socket_connect($this->BotSocket, $this->BotConfig['server'], $this->BotConfig['port'])) {
die('Socket error3 : '.socket_strerror(socket_last_error()));
}
以及连接字符串:
$this->BotConfig = array(
/**
* Bot configuration for information
*/
'nickname' => 'Muts',
'realname' => 'Vii personal funbot',
'ident' => 'Muts',
/**
* Bot server configration
*/
'hostname' => 0,
'server' => 'OGN2.OnlineGamesNet.net',
'port' => 6667,
(数组中有更多的是正确关闭的)和我得到的错误:
警告:socket_connect()[function.socket-connect]:无法连接[110]:/home/functions/public_html/functions/functions.php LINE:404错误类型:连接超时
有人能帮我吗
还值得注意的是:- 使用与telnet相同的连接设置-使用与mIRC相同的连接设置-它在Web服务器上运行(外部而不是本地计算机)
主机的结果:OGN2.OnlineGamesNet.net的别名ogn2.ogamenet.net。ogn2.ogamenet.net具有地址79.110.87.154- traceroute:跟踪路由到79.110.87.154(79.110.87.154),最多30跳,40字节数据包
2条答案
按热度按时间huus2vyu1#
该错误指向外部的东西,而不是您的代码-特别是如果它以前工作。
请检查防火墙设置和套接字端口,并检查要连接的服务器是否处于活动状态。
kb5ga3dv2#
将以下代码添加到PHP文件的顶部,以获取更详细的错误消息:
如果您有SSH访问权限,请给予以下操作:
DNS问题?
路由问题?
尝试完整TCP握手