setName('webSocketServer') ->setDescription('the webSocketServer command'); } protected function main() { parent::main(); // TODO: Change the autogenerated stub $this->writeln("webSocketServer","info"); $work=new \app\common\workman\WebSocketServer(); $work->start(); /*while (true){ }*/ $this->writeln("end","info"); //启动websocket服务 } }