Skip to content

mix-plus/rpc-multiplex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

多路复用组件

安装

composer require mix-plus/rpc-multiplex

测试

# 客户端
$max = 100;
    go(function () use ($max) {
        $client = new Client('127.0.0.1', 9601);
        for ($i = 0; $i < $max; ++$i) {
            go(function () use ($client) {
                $client->request('World.');
            });
        }
    });
# 服务端
go(function () {
    $server = new Server();
    $config = [];
    echo 'swoole server running...';
    $server->bind('0.0.0.0', 9601, $config)->handle(static function (Packet $packet) {
        var_dump('hello' . $packet->getBody());
    })->start();
});

结果

swoole server running...string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."
string(11) "helloWorld."

LICENSE

Apache License Version 2.0, http://www.apache.org/licenses/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages