这里用swoole_client 举个例子( swoft2.*) $client = new \swoole_client(SWOOLE_SOCK_TCP); if (!$client->connect('10.10.10.15', 18307, 0.5)) { return "connect failed. Error: {$client->errCode}\n"; } $client->send(json_encode([ "jsonrpc" => '2.0', "method" => sprintf("%s::%s::%s", "1.2", \App\Rpc\Lib\UserInterface::class, 'getList'), 'params' => [1,2], 'id' => '', 'ext' => [] ])."\r\n\r\n");// 旧版不需要追加\r\n /...