WebSocketClient.php 761 B

12345678910111213141516171819202122232425262728293031323334
  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 WebSocketClient extends Base
  10. {
  11. protected function configure()
  12. {
  13. // 指令配置
  14. $this->setName('webSocketClient')
  15. ->setDescription('the webSocketClient 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\WebSocketClient();
  22. $work->start();
  23. /*while (true){
  24. }*/
  25. $this->writeln("end","info");
  26. //启动websocket服务
  27. }
  28. }