update Hello example Module

This commit is contained in:
whale 2020-03-08 17:05:12 +08:00
parent 6f32d117d0
commit efce1767e6

View File

@ -5,11 +5,9 @@ namespace Module\Example;
use Framework\Console;
use Framework\ZMBuf;
use ZM\Annotation\CQ\CQCommand;
use ZM\Annotation\Http\Controller;
use ZM\Annotation\Http\RequestMapping;
use ZM\Annotation\Module\Closed;
use ZM\Annotation\Swoole\SwooleEventAt;
use ZM\Connection\CQConnection;
use ZM\ModBase;
@ -48,4 +46,12 @@ class Hello extends ModBase
public function pong(){
$this->response->end("ping");
}
/**
* @SwooleEventAt(type="open",rule="connectType:unknown")
*/
public function closeUnknownConn(){
Console::info("Unknown connection , I will close it.");
$this->connection->close();
}
}