Methods | ||
---|---|---|
public
|
wsStartServer($host, $port)
|
# |
public
|
wsStopServer()
|
# |
public
|
wsCheckIdleClients()
|
# |
public
|
wsAddClient($socket, $clientIP)
|
# |
public
|
wsRemoveClient($clientID)
|
# |
public
|
wsGetNextClientID()
|
# |
public
|
wsGetClientSocket($clientID)
|
# |
public
|
wsProcessClient($clientID, &$buffer, $bufferLength)
|
# |
public
|
wsBuildClientFrame($clientID, &$buffer, $bufferLength)
|
# |
public
|
wsCheckSizeClientFrame($clientID)
|
# |
public
|
wsProcessClientFrame($clientID)
|
# |
public
|
wsProcessClientMessage($clientID, $opcode, &$data, $dataLength)
|
# |
public
|
wsProcessClientHandshake($clientID, &$buffer)
|
# |
public
|
wsSendClientMessage($clientID, $opcode, $message)
|
# |
public
|
wsSendClientClose($clientID, $status = false)
|
# |
public
|
wsClose($clientID)
|
# |
public
|
wsSend($clientID, $message, $binary = false)
|
# |
public
|
log($message)
|
# |
public
|
bind($type, $func)
|
# |
public
|
unbind($type = '')
|
# |
Constants | ||
---|---|---|
public
|
WS_MAX_CLIENTS = 100
|
# |
public
|
WS_MAX_CLIENTS_PER_IP = 15
|
# |
public
|
WS_TIMEOUT_RECV = 10
|
# |
public
|
WS_TIMEOUT_PONG = 5
|
# |
public
|
WS_MAX_FRAME_PAYLOAD_RECV = 100000
|
# |
public
|
WS_MAX_MESSAGE_PAYLOAD_RECV = 500000
|
# |
public
|
WS_FIN = 128
|
# |
public
|
WS_MASK = 128
|
# |
public
|
WS_OPCODE_CONTINUATION = 0
|
# |
public
|
WS_OPCODE_TEXT = 1
|
# |
public
|
WS_OPCODE_BINARY = 2
|
# |
public
|
WS_OPCODE_CLOSE = 8
|
# |
public
|
WS_OPCODE_PING = 9
|
# |
public
|
WS_OPCODE_PONG = 10
|
# |
public
|
WS_PAYLOAD_LENGTH_16 = 126
|
# |
public
|
WS_PAYLOAD_LENGTH_63 = 127
|
# |
public
|
WS_READY_STATE_CONNECTING = 0
|
# |
public
|
WS_READY_STATE_OPEN = 1
|
# |
public
|
WS_READY_STATE_CLOSING = 2
|
# |
public
|
WS_READY_STATE_CLOSED = 3
|
# |
public
|
WS_STATUS_NORMAL_CLOSE = 1000
|
# |
public
|
WS_STATUS_GONE_AWAY = 1001
|
# |
public
|
WS_STATUS_PROTOCOL_ERROR = 1002
|
# |
public
|
WS_STATUS_UNSUPPORTED_MESSAGE_TYPE = 1003
|
# |
public
|
WS_STATUS_MESSAGE_TOO_BIG = 1004
|
# |
public
|
WS_STATUS_TIMEOUT = 3000
|
# |
Properties | |||
---|---|---|---|
public
|
|
$wsClients = []
|
# |
public
|
|
$wsClientsExt = []
|
# |
public
|
|
$wsRead = []
|
# |
public
|
|
$wsClientCount = 0
|
# |
public
|
|
$wsClientIPCount = []
|
# |
public
|
|
$wsOnEvents = []
|
# |