socket.IO 的 PHP 版本:PHPSocket.IO

WBOY
Release: 2016-06-23 13:24:38
Original
2072 people have browsed it

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);  });});
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!