1 Star 0 Fork 14

kongxiaojie/webman物联网管理平台

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SipServer.php 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
不败少龙 提交于 2024-04-22 16:16 . install sip
<?php
namespace process;
use Workerman\Connection\ConnectionInterface;
use Workerman\Connection\TcpConnection;
use Workerman\Worker;
class SipServer
{
protected $config;
public function __construct($config)
{
$this->config = $config;
}
public function onWorkerStart(Worker $worker)
{
echo ' ----- SIP Server Worker gets to work, Current workerID: ' . $worker->id . '-----', PHP_EOL;
}
public function onWorkerReload(Worker $worker)
{
}
public function onConnect(TcpConnection $connection)
{
echo "Current workerID: {$connection->id} & new connection from ip {$connection->getRemoteIp()}:{$connection->getRemotePort()}", PHP_EOL;
}
public function onMessage(ConnectionInterface $connection, $data)
{
var_dump($data);
}
public function onClose(TcpConnection $connection)
{
echo 'The ip ' . $connection->getRemoteIp() . ':' . $connection->getRemotePort() . ' is Disconnect', PHP_EOL;
}
public function onError(TcpConnection $connection, $code, $msg)
{
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/kongxiaojie/webman_iot.git
git@gitee.com:kongxiaojie/webman_iot.git
kongxiaojie
webman_iot
webman物联网管理平台
master

搜索帮助