PHP Class Kraken\Ipc\Socket\SocketListener

Inheritance: extends Kraken\Event\BaseEventEmitter, implements Kraken\Ipc\Socket\SocketListenerInterface, use trait Kraken\Loop\LoopAwareTrait
Show file Open project: kraken-php/framework Class Usage Examples

Protected Properties

Property Type Description
$open boolean
$paused boolean
$socket resource

Public Methods

Method Description
__construct ( string | resource $endpointOrResource, Kraken\Loop\LoopInterface $loop, mixed[] $config = [] )
__destruct ( )
close ( )
getLocalAddress ( )
getLocalEndpoint ( )
getLocalHost ( )
getLocalPort ( )
getMetadata ( )
getResource ( )
getResourceId ( )
getStreamType ( )
getWrapperType ( )
handleClose ( ) Handle closing event.
handleConnect ( ) Handle the new connection.
isOpen ( )
isPaused ( )
pause ( )
resume ( )
stop ( )

Protected Methods

Method Description
createClient ( resource $resource ) : Kraken\Ipc\Socket\SocketInterface Create the client resource.
createServer ( string $endpoint, mixed[] $config = [] ) : resource Create the server resource.

Private Methods

Method Description
parseEndpoint ( ) : string

Method Details

__construct() public method

public __construct ( string | resource $endpointOrResource, Kraken\Loop\LoopInterface $loop, mixed[] $config = [] )
$endpointOrResource string | resource
$loop Kraken\Loop\LoopInterface
$config mixed[]

__destruct() public method

public __destruct ( )

close() public method

public close ( )

createClient() protected method

This method creates client resource for socket connections.
protected createClient ( resource $resource ) : Kraken\Ipc\Socket\SocketInterface
$resource resource
return Kraken\Ipc\Socket\SocketInterface

createServer() protected method

This method creates server resource for socket connections.
protected createServer ( string $endpoint, mixed[] $config = [] ) : resource
$endpoint string
$config mixed[]
return resource

getLocalAddress() public method

public getLocalAddress ( )

getLocalEndpoint() public method

public getLocalEndpoint ( )

getLocalHost() public method

public getLocalHost ( )

getLocalPort() public method

public getLocalPort ( )

getMetadata() public method

public getMetadata ( )

getResource() public method

public getResource ( )

getResourceId() public method

public getResourceId ( )

getStreamType() public method

public getStreamType ( )

getWrapperType() public method

public getWrapperType ( )

handleClose() public method

Handle closing event.
public handleClose ( )

handleConnect() public method

Handle the new connection.
public handleConnect ( )

isOpen() public method

public isOpen ( )

isPaused() public method

public isPaused ( )

pause() public method

public pause ( )

resume() public method

public resume ( )

stop() public method

public stop ( )

Property Details

$open protected property

protected bool $open
return boolean

$paused protected property

protected bool $paused
return boolean

$socket protected property

protected resource $socket
return resource