client.php 334 B

1234567891011121314
  1. <?php
  2. Co\run(
  3. function () {
  4. $client = new Swoole\Coroutine\Client(SWOOLE_SOCK_UDP | SWOOLE_SSL);
  5. echo "connect\n";
  6. $client->connect("127.0.0.1", 9905);
  7. echo "connect OK\n";
  8. $client->send("hello world");
  9. echo $client->recv();
  10. $client->close();
  11. echo "END\n";
  12. }
  13. );