\SocketService

Summary

Methods
Properties
Constants
__construct()
service()
run()
handshaking()
message()
send()
frame()
close()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$address
$port
$_sockets
N/A

Properties

$address

$address

$port

$port

$_sockets

$_sockets

Methods

__construct()

__construct(mixed  $address = '', mixed  $port = '') : mixed

Parameters

mixed $address
mixed $port

Returns

mixed —

service()

service() : mixed

Returns

mixed —

run()

run() : mixed

Returns

mixed —

handshaking()

handshaking( $newClient, mixed  $line) : int

握手处理

Parameters

$newClient

socket

mixed $line

Returns

int —

接收到的信息

message()

message( $buffer) : null|string

解析接收数据

Parameters

$buffer

Returns

null|string —

send()

send( $newClinet,  $msg) : int|string

发送数据

Parameters

$newClinet

新接入的socket

$msg

要发送的数据

Returns

int|string —

frame()

frame(mixed  $s) : mixed

Parameters

mixed $s

Returns

mixed —

close()

close() : mixed

关闭socket

Returns

mixed —