raylin666/client

The underlying encapsulation of swoole client.

v1.0.0 2021-07-17 15:03 UTC

This package is auto-updated.

Last update: 2025-04-18 16:23:15 UTC


README

GitHub release PHP version GitHub license

环境要求

  • PHP >=7.3

安装说明

composer require "raylin666/client"

使用方式

<?php

require_once 'vendor/autoload.php';

go(function () {
    $client = new Raylin666\Client\Client;
    $swooleClient = $client()->getFactory()->getClient();

    $options = new Raylin666\Client\Swoole\SwooleClientOptions;
    $swooleClient->set($options);

    $swooleClient->connect('127.0.0.1', 9903);
    $swooleClient->send(['a' => 'c']);
    $result = $swooleClient->recv();
    var_dump($result);
    $swooleClient->close();
});

\Swoole\Event::wait();

更新日志

请查看 CHANGELOG.md

联系

如果你在使用中遇到问题,请联系: 1099013371@qq.com. 博客: kaka 梦很美

License MIT