\Workerman\ConnectionConnectionInterface

ConnectionInterface.

Summary

Methods
Properties
Constants
send()
getRemoteIp()
getRemotePort()
getRemoteAddress()
getLocalIp()
getLocalPort()
getLocalAddress()
isIPv4()
isIPv6()
close()
$statistics
$onMessage
$onClose
$onError
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$statistics

$statistics : array

Statistics for status command.

Type

array

$onMessage

$onMessage : callable

Emitted when data is received.

Type

callable

$onClose

$onClose : callable

Emitted when the other end of the socket sends a FIN packet.

Type

callable

$onError

$onError : callable

Emitted when an error occurs with connection.

Type

callable

Methods

send()

send(mixed  $send_buffer) : void|bool

Sends data on the connection.

Parameters

mixed $send_buffer

Returns

void|bool —

getRemoteIp()

getRemoteIp() : string

Get remote IP.

Returns

string —

getRemotePort()

getRemotePort() : int

Get remote port.

Returns

int —

getRemoteAddress()

getRemoteAddress() : string

Get remote address.

Returns

string —

getLocalIp()

getLocalIp() : string

Get local IP.

Returns

string —

getLocalPort()

getLocalPort() : int

Get local port.

Returns

int —

getLocalAddress()

getLocalAddress() : string

Get local address.

Returns

string —

isIPv4()

isIPv4() : bool

Is ipv4.

Returns

bool —

isIPv6()

isIPv6() : bool

Is ipv6.

Returns

bool —

close()

close(string|null  $data = null) : void

Close connection.

Parameters

string|null $data