Home - ThomasDupont/php_websocket GitHub Wiki

Welcome to the PHP_websocket wiki!

##Server configuration and launch ###Launch with default configuration

$socket = new WebSocket();
$socket->run();
Description Unit Value Method
host string localhost constructor
port int 9001 constructor
Authorized domains array localhost setAuthorizedDomains(array $list)
Buffer size in octet int 1024 setbufferOctets(int $octets)
Maximum of user's connection int 100 setMaxUsersConnected(int $max)
Socket Time out (the waiting time for datas) in microseconds int 10000 setSocketTimeOut(int $msec)
Domain use for socket connection (virtualHost) string localhost setDomainForSocket(string $domain)
The log and max memory limit If the log Limit is exceeded, the program log the memory usage, if the max limit is exceeded, the program pause int memory_limit setMemoryLimits(int $logLimit, int $maxLimit)

Add a model class (as example)

The Models Interface perform method who must be implemented to get the instance of the WebSocket.