Documentation

ResourceServerSocket
in package
implements ServerSocket, ResourceStream uses ForbidCloning, ForbidSerialization

FinalYes

Table of Contents

Interfaces

ServerSocket
ResourceStream

Properties

$acceptor  : Suspension|null
$address  : SocketAddress
$bindContext  : BindContext
$callbackId  : string
$cancel  : callable(CancelledException): void
$chunkSize  : int
$errorHandler  : Closure
$onClose  : DeferredFuture
$socket  : resource|null

Methods

__construct()  : mixed
__destruct()  : mixed
Automatically cancels the loop watcher.
__serialize()  : never
__unserialize()  : never
accept()  : ResourceSocket|null
close()  : void
Closes the server and stops accepting connections. Any socket clients accepted will not be closed.
getAddress()  : SocketAddress
getBindContext()  : BindContext
getResource()  : resource|null
Raw stream socket resource.
isClosed()  : bool
Returns whether this resource has been closed.
onClose()  : void
Registers a callback that is invoked when this resource is closed.
reference()  : void
References the readability callback used for detecting new connection attempts in {@code accept()}.
unreference()  : void
Unreferences the readability callback used for detecting new connection attempts in {@code accept()}.
__clone()  : mixed
acceptSocketClient()  : resource|false
free()  : void

Properties

Methods

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

close()

Closes the server and stops accepting connections. Any socket clients accepted will not be closed.

public close() : void

getResource()

Raw stream socket resource.

public getResource() : resource|null
Return values
resource|null

isClosed()

Returns whether this resource has been closed.

public isClosed() : bool
Return values
bool

true if closed, otherwise false.

onClose()

Registers a callback that is invoked when this resource is closed.

public onClose(Closure $onClose) : void
Parameters
$onClose : Closure

acceptSocketClient()

private acceptSocketClient() : resource|false
Return values
resource|false

        
On this page

Search results