Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<?php
$client = new swoole_client(SWOOLE_SOCK_UNIX_STREAM, SWOOLE_SOCK_ASYNC);
$client->on("connect", function (swoole_client $cli)
{
$cli->send("GET / HTTP/1.1\r\n\r\n");
});
$client->on("receive", function (swoole_client $cli, $data)
{
echo "Receive: $data";
$cli->send(str_repeat('A', 100) . "\n");
});
$client->on("error", function (swoole_client $cli)
{
echo "error: [" . $cli->errCode . "] " . socket_strerror($cli->errCode) . "\n";
});
$client->on("close", function (swoole_client $cli)
{
echo "Connection close\n";
});
$client->connect(__DIR__ . '/svr.sock', 0, -1);
swoole_event_wait();
echo "exit\n";