WebSocketServer.php 763 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\command;
  4. use think\console\Command;
  5. use think\console\Input;
  6. use think\console\input\Argument;
  7. use think\console\input\Option;
  8. use think\console\Output;
  9. class WebSocketServer extends Base
  10. {
  11. protected function configure()
  12. {
  13. // 指令配置
  14. $this->setName('webSocketServer')
  15. ->setDescription('the webSocketServer command');
  16. }
  17. protected function main()
  18. {
  19. parent::main(); // TODO: Change the autogenerated stub
  20. $this->writeln("webSocketServer","info");
  21. $work=new \app\common\workman\WebSocketServer();
  22. $work->start();
  23. /*while (true){
  24. }*/
  25. $this->writeln("end","info");
  26. //启动websocket服务
  27. }
  28. }