Skip to content

Commit

Permalink
add PHPSocketIO
Browse files Browse the repository at this point in the history
add PHPSocketIO
  • Loading branch information
lobtao committed May 11, 2018
1 parent d3e1aef commit e285722
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/PHPSocketIO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Created by lobtao.
* Date: 2018/5/11
* Time: 上午11:26
*/

namespace lobtao\tp5helper;


use PHPSocketIO\SocketIO;
use Workerman\Worker;

abstract class PHPSocketIO
{
protected $io;
protected $opts = [];
protected $port = '9982';

/**
* 架构函数
* @access public
*/
public function __construct() {

// 实例化 SocketIO 服务
$this->io = new SocketIO($this->port, $this->opts);
// 初始化
$this->init();
// Run worker
Worker::runAll();
}

protected function init() {
}
}

0 comments on commit e285722

Please sign in to comment.