phpday 2027 - Call for Papers

The Swoole\Client class

(PECL swoole >= 1.9.0)

Introduction

Class synopsis

class Swoole\Client {
/* Constants */
const int MSG_OOB = 1;
const int MSG_PEEK = 2;
const int MSG_DONTWAIT = 128;
const int MSG_WAITALL = 64;
/* Properties */
public $errCode;
public $sock;
public $reuse;
public $reuseCount;
/* Methods */
public function close(bool $force = ?): bool
public function connect(
    string $host,
    int $port = ?,
    int $timeout = ?,
    int $flag = ?
): bool
public function __destruct(): void
public function getpeername(): array
public function getsockname(): array
public function isConnected(): bool
public function on(string $event, callable $callback): void
public function pause(): void
public function pipe(string $socket): void
public function recv(string $size = ?, string $flag = ?): void
public function resume(): void
public function send(string $data, string $flag = ?): int
public function sendfile(string $filename, int $offset = ?): bool
public function sendto(string $ip, int $port, string $data): bool
public function set(array $settings): void
public function sleep(): void
public function wakeup(): void
}

Properties

errCode

sock

reuse

reuseCount

Table of Contents

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top