WebSocket
in package
implements
EventEmitterInterface
uses
EventEmitterTrait
Table of Contents
Interfaces
Properties
- $request : RequestInterface
- The request headers sent to establish the connection
- $response : ResponseInterface
- The response headers received from the server to establish the connection
- $_close : Closure
- $_stream : ConnectionInterface
- $listeners : mixed
- $onceListeners : mixed
Methods
- __construct() : mixed
- WebSocket constructor.
- close() : mixed
- emit() : mixed
- listeners() : array<string|int, mixed>
- on() : mixed
- once() : mixed
- pause() : mixed
- removeAllListeners() : mixed
- removeListener() : mixed
- resume() : mixed
- send() : mixed
Properties
$request
The request headers sent to establish the connection
public
RequestInterface
$request
$response
The response headers received from the server to establish the connection
public
ResponseInterface
$response
$_close
protected
Closure
$_close
$_stream
protected
ConnectionInterface
$_stream
$listeners
protected
mixed
$listeners
= []
$onceListeners
protected
mixed
$onceListeners
= []
Methods
__construct()
WebSocket constructor.
public
__construct(ConnectionInterface $stream, ResponseInterface $response, RequestInterface $request) : mixed
Parameters
- $stream : ConnectionInterface
- $response : ResponseInterface
- $request : RequestInterface
Tags
close()
public
close([mixed $code = 1000 ][, mixed $reason = '' ]) : mixed
Parameters
- $code : mixed = 1000
- $reason : mixed = ''
emit()
public
emit(mixed $event[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $event : mixed
- $arguments : array<string|int, mixed> = []
listeners()
public
listeners([mixed $event = null ]) : array<string|int, mixed>
Parameters
- $event : mixed = null
Return values
array<string|int, mixed>on()
public
on(mixed $event, callable $listener) : mixed
Parameters
- $event : mixed
- $listener : callable
once()
public
once(mixed $event, callable $listener) : mixed
Parameters
- $event : mixed
- $listener : callable
pause()
public
pause() : mixed
removeAllListeners()
public
removeAllListeners([mixed $event = null ]) : mixed
Parameters
- $event : mixed = null
removeListener()
public
removeListener(mixed $event, callable $listener) : mixed
Parameters
- $event : mixed
- $listener : callable
resume()
public
resume() : mixed
send()
public
send(mixed $msg) : mixed
Parameters
- $msg : mixed