Php/docs/class.swoole-client
(PECL swoole >= 1.9.0)
Introduction
Class synopsis
Swoole\Client {
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 close
([ bool $force
] ) : bool
public connect
( string $host
[, int $port
[, int $timeout
[, int $flag
]]] ) : bool
public __destruct ( ) : void
public getpeername ( ) : array
public getsockname ( ) : array
public isConnected ( ) : bool
public pause ( ) : void
public pipe
( string $socket
) : void
public recv
([ string $size
[, string $flag
]] ) : void
public resume ( ) : void
public send
( string $data
[, string $flag
] ) : int
public sendfile
( string $filename
[, int $offset
] ) : bool
public sendto
( string $ip
, int $port
, string $data
) : bool
public set
( array $settings
) : void
public sleep ( ) : void
public wakeup ( ) : void
}
Properties
errCode
sock
reuse
reuseCount
Predefined Constants
Swoole\Client::MSG_OOB
Swoole\Client::MSG_PEEK
Swoole\Client::MSG_DONTWAIT
Swoole\Client::MSG_WAITALL
Table of Contents
- Swoole\Client::close — Close the connection established.
- Swoole\Client::connect — Connect to the remote TCP or UDP port.
- Swoole\Client::__construct — Create Swoole sync or async TCP/UDP client, with or without SSL.
- Swoole\Client::__destruct — Destruct the Swoole client.
- Swoole\Client::getpeername — Get the remote socket name of the connection.
- Swoole\Client::getsockname — Get the local socket name of the connection.
- Swoole\Client::isConnected — Check if the connection is established.
- Swoole\Client::on — Add callback functions triggered by events.
- Swoole\Client::pause — Pause receiving data.
- Swoole\Client::pipe — Redirect the data to another file descriptor.
- Swoole\Client::recv — Receive data from the remote socket.
- Swoole\Client::resume — Resume receiving data.
- Swoole\Client::send — Send data to the remote TCP socket.
- Swoole\Client::sendfile — Send file to the remote TCP socket.
- Swoole\Client::sendto — Send data to the remote UDP address.
- Swoole\Client::set — Set the Swoole client parameters before the connection is established.
- Swoole\Client::sleep — Remove the TCP client from system event loop.
- Swoole\Client::wakeup — Add the TCP client back into the system event loop.
/* Constants */