PHPSocket.IOsocket.IO 的 PHP 版本
PHPSocket.IO 是 socket.IO 的php版本,基于workerman開發(fā)。用于替代socket.IO服務(wù)端,方便用PHP開發(fā)socket.IO即時(shí)通訊應(yīng)用。
實(shí)例代碼:
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);
});
});評(píng)論
圖片
表情
