PHP Interface Kraken\Network\NetworkServerInterface

Inheritance: extends Kraken\Loop\LoopResourceInterface
Show file Open project: kraken-php/framework

Public Methods

Method Description
addRoute ( string $path, Kraken\Network\NetworkComponentInterface $component ) : Kraken\Network\NetworkServerInterface Add an endpoint/application to the server.
blockAddress ( string $address ) : Kraken\Network\NetworkServerInterface Add an address to the blacklist that will not be allowed to connect to your application.
close ( ) Close the underlying SocketListner.
existsRoute ( string $path ) : boolean Check if there exists any endpoint/application to the server on given route.
getBlockedAddresses ( ) : string[] Get an array of all the addresses blocked.
isAddressBlocked ( string $address ) : boolean Check if given $address is blocked or not.
removeRoute ( string $path ) : Kraken\Network\NetworkServerInterface Remote endpoint/application from the server.
stop ( ) Close the underlying SocketListner.
unblockAddress ( string $address ) : Kraken\Network\NetworkServerInterface Unblock an address so they can access your application again.

Method Details

addRoute() public method

Add an endpoint/application to the server.
public addRoute ( string $path, Kraken\Network\NetworkComponentInterface $component ) : Kraken\Network\NetworkServerInterface
$path string
$component Kraken\Network\NetworkComponentInterface
return Kraken\Network\NetworkServerInterface

blockAddress() public method

Add an address to the blacklist that will not be allowed to connect to your application.
public blockAddress ( string $address ) : Kraken\Network\NetworkServerInterface
$address string
return Kraken\Network\NetworkServerInterface

close() public method

Close the underlying SocketListner.
public close ( )

existsRoute() public method

Check if there exists any endpoint/application to the server on given route.
public existsRoute ( string $path ) : boolean
$path string
return boolean

getBlockedAddresses() public method

Get an array of all the addresses blocked.
public getBlockedAddresses ( ) : string[]
return string[]

isAddressBlocked() public method

Check if given $address is blocked or not.
public isAddressBlocked ( string $address ) : boolean
$address string
return boolean

removeRoute() public method

Remote endpoint/application from the server.
public removeRoute ( string $path ) : Kraken\Network\NetworkServerInterface
$path string
return Kraken\Network\NetworkServerInterface

stop() public method

Close the underlying SocketListner.
public stop ( )

unblockAddress() public method

Unblock an address so they can access your application again.
public unblockAddress ( string $address ) : Kraken\Network\NetworkServerInterface
$address string
return Kraken\Network\NetworkServerInterface