我使用了这篇文章中包含的文件:http: //www.flynsarmy.com/2012/02/php-websocket-chat-application-2-0/。然后我将它们注入我的 codeigniter 实验室,但我总是得到一个错误:
Message: socket_bind() [function.socket-bind]: unable to bind address [48]: Address already in use
JS部分告诉我:
Connecting...
Connected.
Disconnected.
我使用了建议的“gethostbyaddr(gethostbyname($_SERVER['SERVER_NAME'])”-方法,还尝试了 ip 没有任何结果。
我想我有一个逻辑错误。我是否需要先关闭服务器端套接字才能重新打开它?我还尝试运行“开箱即用”版本(使用正确的主机名),但仍然没有运气。
谢谢你的帮助!
直播: http: //labs.addictivity.de/websockets/