Skip to content
docs.
WORKSPACE

Your documentation

Explore the project catalog
Localzet ServerАсинхронный PHP-серверTriangleФреймворк и компонентыMIX IDИдентификация и интеграцииHack APIПубличные API хакатонаACNПроект и компонентыUserlay / UserNetПроект и компонентыAxiomПроект и компонентыМесседжинг через почтуПроект и компонентыLWT / JWT / JOSEПроект и компонентыФинансовая аналитика KimaiПроект и компонентыМультипарадигмальная БДПроект и компонентыZorin PlatformПроект и компонентыZorin TrustПроект и компонентыFloraScope / VegwatchПроект и компонентыaegis-qДокументация проектаaevumdbДокументация проектаauditДокументация проектаauto-invest-managerАвтотрейдерcaine-companionДокументация проектаcertbot-cloudflareДокументация проектаClusterLocalzet Server / ClustercmdveilДокументация проектаConsolePHP CLICronБиблиотеки Localzet Serverdata-connectorДокументация проектаdevice-controlDevice Controlenn-projectДокументация проектаEventsБиблиотеки Localzet ServerflowsintДокументация проектаforgeДокументация проектаHttpClientБиблиотеки Localzet ServerinterpreterСобственный языкinvariaДокументация проектаkeynotesДокументация проектаknotrouteKnotroutelaravel-personal-analyticsДокументация проектаlocalzet-osДокументация проектаmeridianДокументация проектаMQTTБиблиотеки Localzet Servernano-kernelСобственная ОСNoterДокументация проектаpersonal-analyticsДокументация проектаProxyБиблиотеки Localzet ServerPSRБиблиотеки Localzet ServerPSR-7Библиотеки Localzet Serverrschs-monitorДокументация проектаsemsealДокументация проектаshardsealДокументация проектаSocketIOБиблиотеки Localzet Server✓SOCKS5Библиотеки Localzet Serverstandalone-analyticsДокументация проектаstatic-php-cliДокументация проектаStorageБиблиотеки Localzet ServersutureДокументация проектаtempoweaveДокументация проектаttsСинтез речиTunnelБиблиотеки Localzet Serverui-kitUI KitvesperДокументация проектаWebAnalyzerWebAnalyzerzorin-access-brokerДокументация проектаzorin-authority-brokerДокументация проектаzorin-authority-sdk-phpДокументация проектаzorin-authority-sdk-pythonДокументация проектаzorin-authority-sdk-tsДокументация проектаzorin-client-intelДокументация проектаzorin-device-core-aospДокументация проектаzorin-host-agentДокументация проектаzorin-native-labДокументация проектаzorin-nodeДокументация проектаzorin-opsДокументация проектаdonstu-python-sdkДокументация проектаfloortraceFloortraceserver-rsLocalzet Server / Cluster
Catalog
Documentation/SocketIO

SocketIO — API

src/ChannelAdapter.php

function __construct($nsp)
function __destruct()
function add($id, $room)
function del($id, $room)
function delAll($id)
function onChannelMessage($channel, $msg)
function broadcast($packet, $opts, $remote = false)

src/Client.php

function __construct($server, $conn)
function __destruct()
function setup()
function connect($name)
function nspAdd($socket, $nsp)
function disconnect()
function remove($socket)
function close()
function packet($packet, $preEncoded = false, $volatile = false)
function writeToEngine($encodedPackets, $volatile = false)
function ondata($data)
function ondecoded($packet)
function onerror($err)
function onclose($reason)
function destroy()

src/Debug.php

static function debug($var)

src/DefaultAdapter.php

function __construct($nsp)
function __destruct()
function add($id, $room)
function del($id, $room)
function delAll($id)
function broadcast($packet, $opts, $remote = false)
function clients($rooms, $fn)

src/Emitter.php

function __construct($ip = '127.0.0.1', $port = 2206, $context = null)
function __get($name)
function to($name)
function in($name)
function emit($ev)

src/Engine/Engine.php

function __construct($opts = [])
function __destruct()
function handleRequest(object $req, object $res)
function dealRequest($err, bool $success, object $req)
function checkRequest(object $req, object $res, callable $fn)
function handshake(string $transport, object $req)
function onSocketClose($id): void
function attach($worker): void
function onConnect(object $connection): void
function onWebSocketConnect($connection, object $req, object $res): void
function dealWebSocketConnect($err, bool $success, object $req, object $res): void

src/Engine/Parser.php

function __construct()
static function encodePacket($packet): string
static function decodePacket(string $data): array
static function decodeBase64Packet($msg): array
static function encodePayload($packets, $supportsBinary = null): string
static function encodeOne($packet): string
static function decodePayload($data, $binaryType = null)
static function encodePayloadAsBinary($packets): string
static function encodeOneAsBinary($p): string
static function decodePayloadAsBinary($data, $binaryType = null): array

localzet\SocketIO\Engine\Protocols\Http\Request

Section titled “localzet\SocketIO\Engine\Protocols\Http\Request”

src/Engine/Protocols/Http/Request.php

function __construct($connection, $raw_head)
function parseHead($raw_head)
function destroy()

localzet\SocketIO\Engine\Protocols\Http\Response

Section titled “localzet\SocketIO\Engine\Protocols\Http\Response”

src/Engine/Protocols/Http/Response.php

function __construct($connection)
function writeHead($status_code, $reason_phrase = '', $headers = null)
function getHeadBuffer(): string
function setHeader($key, $val)
function getHeader($name)
function removeHeader($name)
function write($chunk)
function end($data = null)
function destroy()

localzet\SocketIO\Engine\Protocols\SocketIO

Section titled “localzet\SocketIO\Engine\Protocols\SocketIO”

src/Engine/Protocols/SocketIO.php

static function input($http_buffer, $connection)
static function onData($connection, $data)
static function emitClose($connection)
static function cleanup($connection)
static function emitData($connection, $req, $data)
static function emitEnd($connection, $req)
static function encode($buffer, $connection)
static function decode($http_buffer, $connection)

localzet\SocketIO\Engine\Protocols\WebSocket

Section titled “localzet\SocketIO\Engine\Protocols\WebSocket”

src/Engine/Protocols/WebSocket.php

static function input($buffer, $connection)
static function dealHandshake($connection, $req, $res)
const MIN_HEAD_LEN

localzet\SocketIO\Engine\Protocols\WebSocket\RFC6455

Section titled “localzet\SocketIO\Engine\Protocols\WebSocket\RFC6455”

src/Engine/Protocols/WebSocket/RFC6455.php

static function input(string $buffer, ConnectionInterface $connection): int
static function encode(mixed $buffer, ConnectionInterface $connection): string
static function decode(string $buffer, ConnectionInterface $connection): mixed
static function dealHandshake($connection, $req, $res)
const MIN_HEAD_LEN
const BINARY_TYPE_BLOB
const BINARY_TYPE_ARRAYBUFFER

src/Engine/Socket.php

function __construct($id, $server, $transport, $req)
function __destruct()
function maybeUpgrade(object $transport): void
function onUpgradePacket(array $packet): void
function upgradeCleanup(): void
function onUpgradeTransportClose(): void
function onUpgradeTransportError($err): void
function upgradeTimeoutCallback(object $transport): void
function setTransport(object $transport)
function onOpen(): void
function onPacket(array $packet)
function check(): void
function onError($err): void
function setPingTimeout(): void
function pingTimeoutCallback(): void
function clearTransport(): void
function onClose(string $reason = '', ?string $description = null): void
function send($data, $options, ?callable $callback): Socket
function write($data, ?array $options = [], ?callable $callback = null): Socket
function sendPacket(string $type, $data = null, $callback = null): void
function flush(): void
function getAvailableUpgrades(): array
function close(): void
function closeTransport(): void
function setupSendCallback(): void
function onDrainCallback(): void

src/Engine/Transport.php

function __construct()
function __destruct()
function noop()
function onRequest($req)
function close(?callable $fn = null): void
function onError(string $msg, string $desc = '')
function onPacket($packet): void
function onData($data)
function onClose()
function destroy(): void

localzet\SocketIO\Engine\Transports\Polling

Section titled “localzet\SocketIO\Engine\Transports\Polling”

src/Engine/Transports/Polling.php

function onRequest($req)
function onPollRequest(object $req, object $res): void
function pollRequestOnClose(): void
function pollRequestClean(): void
function onDataRequest($req, $res): void
function dataRequestCleanup(): void
function dataRequestOnClose(): void
function dataRequestOnData($req, $data): void
function dataRequestOnEnd(): void
function onData($data)
function onClose()
function send($packets): void
function write($data): void
function doClose(callable $fn): void

localzet\SocketIO\Engine\Transports\PollingJsonp

Section titled “localzet\SocketIO\Engine\Transports\PollingJsonp”

src/Engine/Transports/PollingJsonp.php

function __construct($req)
function __destruct()
function onData($data)
function doWrite($data): void
function headers(array $headers = []): array

localzet\SocketIO\Engine\Transports\PollingXHR

Section titled “localzet\SocketIO\Engine\Transports\PollingXHR”

src/Engine/Transports/PollingXHR.php

function __construct()
function __destruct()
function onRequest($req)
function doWrite($data)
function headers(object $req, array $headers = []): array

localzet\SocketIO\Engine\Transports\WebSocket

Section titled “localzet\SocketIO\Engine\Transports\WebSocket”

src/Engine/Transports/WebSocket.php

function __construct($req)
function __destruct()
function onData2($connection, $data): void
function onError2($conection, $code, $msg): void
function send(array $packets): void
function doClose(callable $fn = null): void

src/Event/Emitter.php

function __construct()
function __destruct()
function on($event_name, $listener): Emitter
function once($event_name, $listener): Emitter
function removeListener($event_name, $listener): Emitter
function removeAllListeners($event_name = null): Emitter
function listeners($event_name): array
function emit($event_name = null)

src/Nsp.php

function __construct($server, $name)
function __destruct()
function initAdapter()
function to($name): Nsp
function in($name): Nsp
function add($client, $nsp, $fn)
function remove($socket)
function emit($ev = null)
function send(): Nsp
function write()
function clients($fn): Nsp
function compress($compress): Nsp

src/Parser/Decoder.php

function __construct()
function __destruct()
function add($obj): void
function decodeString($str): array
static function error(): array

src/Parser/Encoder.php

function __construct()
function __destruct()
function encode($obj): array
static function encodeAsString($obj): string

src/Parser/Parser.php

const CONNECT
const DISCONNECT
const EVENT
const ACK
const ERROR
const BINARY_EVENT
const BINARY_ACK

src/Socket.php

function __construct($nsp, $client)
function __destruct()
function buildHandshake(): array
function __get($name)
function emit($ev = null)
function to($name): Socket
function in($name): Socket
function send(): Socket
function write(): Socket
function packet($packet, $preEncoded = false)
function join($room): Socket
function leave($room): Socket
function leaveAll()
function onconnect()
function onpacket($packet)
function onevent($packet)
function ack($id): Closure
function onack($packet)
function ondisconnect()
function onerror($err)
function onclose($reason)
function error($err)
function disconnect(bool $close = false): Socket
function compress($compress): Socket

src/SocketIO.php

function __construct($port = null, $opts = [])
function nsp($v = null)
function socket($v = null)
function adapter($v = null)
function origins($v = null)
function attach($srv, $opts = []): SocketIO
function bind($engine): SocketIO
function of($name, $fn = null)
function onConnection($engine_socket): SocketIO
function on()
function in()
function to()
function emit()
function send()
function write()