Home >Backend Development >PHP Tutorial >socket.IO 的 PHP 版本:PHPSocket.IO

socket.IO 的 PHP 版本:PHPSocket.IO

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:24:382129browse

PHPSocket.IO 是 socket.IO 的php版本,基于workerman开发。用于替代socket.IO服务端,方便用PHP开发socket.IO即时通讯应用。 

实例代码:

use PHPSocketIO\SocketIO; // listen port 2021 for socket.io client$io = new SocketIO(2021);$io->on('connection', function($socket)use($io){  $socket->on('chat message', function($msg)use($io){    $io->emit('chat message', $msg);  });});

项目主页:http://www.open-open.com/lib/view/home/1444828274810

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn