\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 : callback

Emitted when data is received.

Type

callback

$onClose

$onClose : callback

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

Type

callback

$onError

$onError : callback

Emitted when an error occurs with connection.

Type

callback

Methods

send()

send(string  $send_buffer) : void|boolean

Sends data on the connection.

Parameters

string $send_buffer

Returns

void|boolean

getRemoteIp()

getRemoteIp() : string

Get remote IP.

Returns

string

getRemotePort()

getRemotePort() : integer

Get remote port.

Returns

integer

getRemoteAddress()

getRemoteAddress() : string

Get remote address.

Returns

string

getLocalIp()

getLocalIp() : string

Get local IP.

Returns

string

getLocalPort()

getLocalPort() : integer

Get local port.

Returns

integer

getLocalAddress()

getLocalAddress() : string

Get local address.

Returns

string

isIPv4()

isIPv4() : boolean

Is ipv4.

Returns

boolean

isIPv6()

isIPv6() : boolean

Is ipv6.

Returns

boolean

close()

close(  $data = null) : void

Close connection.

Parameters

$data