class Socket (View source)

Properties

$fd
$domain
$type
$protocol
$errCode
$errMsg

Methods

__construct($domain, $type, $protocol = null)

No description

mixed
bind(mixed $address, mixed|null $port = null)

No description

mixed
listen(mixed|null $backlog = null)

No description

mixed
accept(mixed|null $timeout = null)

No description

mixed
connect(mixed $host, mixed|null $port = null, mixed|null $timeout = null)

No description

mixed
checkLiveness()

No description

mixed
peek(mixed|null $length = null)

No description

mixed
recv(mixed|null $length = null, mixed|null $timeout = null)

No description

mixed
recvAll(mixed|null $length = null, mixed|null $timeout = null)

No description

mixed
recvLine(mixed|null $length = null, mixed|null $timeout = null)

No description

mixed
recvWithBuffer(mixed|null $length = null, mixed|null $timeout = null)

No description

mixed
recvPacket(mixed|null $timeout = null)

No description

mixed
send(mixed $data, mixed|null $timeout = null)

No description

mixed
readVector(mixed $io_vector, mixed|null $timeout = null)

No description

mixed
readVectorAll(mixed $io_vector, mixed|null $timeout = null)

No description

mixed
writeVector(mixed $io_vector, mixed|null $timeout = null)

No description

mixed
writeVectorAll(mixed $io_vector, mixed|null $timeout = null)

No description

mixed
sendFile(mixed $filename, mixed|null $offset = null, mixed|null $length = null)

No description

mixed
sendAll(mixed $data, mixed|null $timeout = null)

No description

mixed
recvfrom(mixed $peername, mixed|null $timeout = null)

No description

mixed
sendto(mixed $addr, mixed $port, mixed $data)

No description

mixed
getOption(mixed $level, mixed $opt_name)

No description

bool
setProtocol(array $settings)

No description

mixed
setOption(mixed $level, mixed $opt_name, mixed $opt_value)

No description

bool
sslHandshake()

No description

bool
shutdown(int $how = Client::SHUT_RDWR)

No description

bool
cancel(int $event = SWOOLE_EVENT_READ)

No description

bool
close()

No description

array|false
getpeername()

No description

array|false
getsockname()

No description

bool
isClosed()

No description

Details

__construct($domain, $type, $protocol = null)

No description

Parameters

$domain
$type
$protocol

mixed bind(mixed $address, mixed|null $port = null)

No description

Parameters

mixed $address
mixed|null $port

Return Value

mixed

mixed listen(mixed|null $backlog = null)

No description

Parameters

mixed|null $backlog

Return Value

mixed

mixed accept(mixed|null $timeout = null)

No description

Parameters

mixed|null $timeout

Return Value

mixed

mixed connect(mixed $host, mixed|null $port = null, mixed|null $timeout = null)

No description

Parameters

mixed $host
mixed|null $port
mixed|null $timeout

Return Value

mixed

mixed checkLiveness()

No description

Return Value

mixed

mixed peek(mixed|null $length = null)

No description

Parameters

mixed|null $length

Return Value

mixed

mixed recv(mixed|null $length = null, mixed|null $timeout = null)

No description

Parameters

mixed|null $length
mixed|null $timeout

Return Value

mixed

mixed recvAll(mixed|null $length = null, mixed|null $timeout = null)

No description

Parameters

mixed|null $length
mixed|null $timeout

Return Value

mixed

mixed recvLine(mixed|null $length = null, mixed|null $timeout = null)

No description

Parameters

mixed|null $length
mixed|null $timeout

Return Value

mixed

mixed recvWithBuffer(mixed|null $length = null, mixed|null $timeout = null)

No description

Parameters

mixed|null $length
mixed|null $timeout

Return Value

mixed

mixed recvPacket(mixed|null $timeout = null)

No description

Parameters

mixed|null $timeout

Return Value

mixed

mixed send(mixed $data, mixed|null $timeout = null)

No description

Parameters

mixed $data
mixed|null $timeout

Return Value

mixed

mixed readVector(mixed $io_vector, mixed|null $timeout = null)

No description

Parameters

mixed $io_vector
mixed|null $timeout

Return Value

mixed

mixed readVectorAll(mixed $io_vector, mixed|null $timeout = null)

No description

Parameters

mixed $io_vector
mixed|null $timeout

Return Value

mixed

mixed writeVector(mixed $io_vector, mixed|null $timeout = null)

No description

Parameters

mixed $io_vector
mixed|null $timeout

Return Value

mixed

mixed writeVectorAll(mixed $io_vector, mixed|null $timeout = null)

No description

Parameters

mixed $io_vector
mixed|null $timeout

Return Value

mixed

mixed sendFile(mixed $filename, mixed|null $offset = null, mixed|null $length = null)

No description

Parameters

mixed $filename
mixed|null $offset
mixed|null $length

Return Value

mixed

mixed sendAll(mixed $data, mixed|null $timeout = null)

No description

Parameters

mixed $data
mixed|null $timeout

Return Value

mixed

mixed recvfrom(mixed $peername, mixed|null $timeout = null)

No description

Parameters

mixed $peername
mixed|null $timeout

Return Value

mixed

mixed sendto(mixed $addr, mixed $port, mixed $data)

No description

Parameters

mixed $addr
mixed $port
mixed $data

Return Value

mixed

mixed getOption(mixed $level, mixed $opt_name)

No description

Parameters

mixed $level
mixed $opt_name

Return Value

mixed

bool setProtocol(array $settings)

No description

Parameters

array $settings

Return Value

bool

Returns TRUE if succeed; otherwise FALSE.

mixed setOption(mixed $level, mixed $opt_name, mixed $opt_value)

No description

Parameters

mixed $level
mixed $opt_name
mixed $opt_value

Return Value

mixed

bool sslHandshake()

No description

Return Value

bool

bool shutdown(int $how = Client::SHUT_RDWR)

No description

Parameters

int $how

A Client::SHUT_* constant.

Return Value

bool

bool cancel(int $event = SWOOLE_EVENT_READ)

No description

Parameters

int $event

Must be constant SWOOLE_EVENT_READ or SWOOLE_EVENT_WRITE.

Return Value

bool

bool close()

No description

Return Value

bool

array|false getpeername()

No description

Return Value

array|false

If succeeds, return an array with two fields in it: "address" and "port"; otherwise, return FALSE.

array|false getsockname()

No description

Return Value

array|false

If succeeds, return an array with two fields in it: "address" and "port"; otherwise, return FALSE.

bool isClosed()

Since: 4.8.3

No description

Return Value

bool