Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Jul 25, 2018
1 parent c43be1a commit e89364a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ private function registerErrorHandler()
private function mainServerHook($type)
{
if($type === ServerManager::TYPE_SERVER){

ServerManager::getInstance()->getSwooleServer()->on(EventRegister::onReceive,function (\swoole_server $server, int $fd, int $reactor_id, string $data){
EasySwooleEvent::onReceive($server,$fd,$reactor_id,$data);
});
}else{
$namespace = Di::getInstance()->get(SysConst::HTTP_CONTROLLER_NAMESPACE);
if(empty($namespace)){
Expand Down
6 changes: 6 additions & 0 deletions src/Resource/EasySwooleEvent.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ class EasySwooleEvent implements Event
{
// TODO: Implement afterAction() method.
}

public static function onReceive(\swoole_server $server, int $fd, int $reactor_id, string $data):void
{
}

}

0 comments on commit e89364a

Please sign in to comment.