Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Swoole\Client::resumeSwoole\Client::sendfile>
^Swoole\ClientLast updated: Mon, 26 Oct 2026

Swoole\Client::send

(PECL swoole >= 1.9.0)

Swoole\Client::send — Send data to the remote TCP socket.

Description

public function Swoole\Client::send(string $data, string $flag = ?): int

Parameters

data

The data to send which can be string or binary

flag

Return Values

If the client sends data successfully, it returns the length of data sent. Or it returns false and sets $swoole_client->errCode. For sync client, there is no limit for the data to send. For async client, The limit for the data to send is socket_buffer_size.


<Swoole\Client::resumeSwoole\Client::sendfile>
^Swoole\ClientLast updated: Mon, 26 Oct 2026