PHP 클래스 Kraken\Channel\Model\Socket\Socket

상속: extends Kraken\Event\BaseEventEmitter, implements Kraken\Channel\ChannelModelInterface
파일 보기 프로젝트 열기: kraken-php/framework

보호된 프로퍼티들

프로퍼티 타입 설명
$connectionPool Kraken\Channel\Model\Socket\Connection\ConnectionPool
$endpoint string
$flags string[]
$frameBuffer string[]
$hosts string[]
$id string
$isConnected boolean
$loop Kraken\Loop\LoopInterface
$offlineBuffer Kraken\Channel\Model\Socket\Buffer\Buffer
$onlineBuffer Kraken\Channel\Model\Socket\Buffer\Buffer
$options mixed[]
$socket Kraken\Ipc\Socket\SocketInterface | Kraken\Ipc\Socket\SocketListenerInterface | null
$type integer

공개 메소드들

메소드 설명
__construct ( Kraken\Loop\LoopInterface $loop, string[] $params )
__destruct ( )
broadcast ( $message )
getConnected ( )
isConnected ( $id )
isStarted ( )
isStopped ( )
markConnectionOnline ( string $id, float $until ) Set connection statically to be marked as online until specific timestamp.
markConnectionPersistent ( string $id ) Set connection statically to be marked always as online.
onData ( Kraken\Ipc\Socket\SocketInterface $client, string $data )
start ( $blockEvent = false )
stop ( $blockEvent = false )
unicast ( $id, $message, $flags = Channel::MODE_STANDARD )

보호된 메소드들

메소드 설명
createBinder ( ) : Kraken\Ipc\Socket\SocketListenerInterface
createConnector ( ) : Kraken\Ipc\Socket\SocketInterface
destroyBinder ( )
destroyConnector ( )
getBuffer ( ) : Buffer
getConnectionPool ( ) : ConnectionPool
parseBinderMessage ( string $message ) : string[]
parseConnectorMessage ( string $message ) : string[]
prepareBinderMessage ( string $id, string $type ) : string[]
prepareConnectorMessage ( string $id, string $type ) : string[]
removeEventListener ( string $event, callable $callback )
setEventListener ( string $event, callable $callback )

비공개 메소드들

메소드 설명
clearConnectionPool ( ) Clear connection pool.
getFrame ( string $id, string $type, string $message ) : null | string
heartbeat ( string $id ) : boolean
onMessage ( Kraken\Ipc\Socket\SocketInterface $client, string $message )
onRecvHeartbeat ( Connection $conn )
onRecvMessage ( Connection $conn, string[] $message )
recvHeartbeat ( Connection $conn )
recvMessage ( Connection $conn, $message ) : mixed
sendMessage ( string $id, string $type, string | string[] $message = null, integer $flags = Channel::MODE_STANDARD ) : boolean
startConnection ( ) : boolean
startHeartbeat ( ) Start heartbeat.
startTimeRegister ( ) Start time register.
stopConnection ( ) : boolean
stopHeartbeat ( ) Stop hearbeat.
stopTimeRegister ( ) Stop time register.
writeData ( string $id, string $data ) : boolean

메소드 상세

__construct() 공개 메소드

public __construct ( Kraken\Loop\LoopInterface $loop, string[] $params )
$loop Kraken\Loop\LoopInterface
$params string[]

__destruct() 공개 메소드

public __destruct ( )

broadcast() 공개 메소드

public broadcast ( $message )

createBinder() 보호된 메소드

protected createBinder ( ) : Kraken\Ipc\Socket\SocketListenerInterface
리턴 Kraken\Ipc\Socket\SocketListenerInterface

createConnector() 보호된 메소드

protected createConnector ( ) : Kraken\Ipc\Socket\SocketInterface
리턴 Kraken\Ipc\Socket\SocketInterface

destroyBinder() 보호된 메소드

protected destroyBinder ( )

destroyConnector() 보호된 메소드

protected destroyConnector ( )

getBuffer() 보호된 메소드

protected getBuffer ( ) : Buffer
리턴 Kraken\Channel\Model\Socket\Buffer\Buffer

getConnected() 공개 메소드

public getConnected ( )

getConnectionPool() 보호된 메소드

protected getConnectionPool ( ) : ConnectionPool
리턴 Kraken\Channel\Model\Socket\Connection\ConnectionPool

isConnected() 공개 메소드

public isConnected ( $id )

isStarted() 공개 메소드

public isStarted ( )

isStopped() 공개 메소드

public isStopped ( )

markConnectionOnline() 공개 메소드

Set connection statically to be marked as online until specific timestamp.
public markConnectionOnline ( string $id, float $until )
$id string
$until float

markConnectionPersistent() 공개 메소드

Set connection statically to be marked always as online.

onData() 공개 메소드

public onData ( Kraken\Ipc\Socket\SocketInterface $client, string $data )
$client Kraken\Ipc\Socket\SocketInterface
$data string

parseBinderMessage() 보호된 메소드

protected parseBinderMessage ( string $message ) : string[]
$message string
리턴 string[]

parseConnectorMessage() 보호된 메소드

protected parseConnectorMessage ( string $message ) : string[]
$message string
리턴 string[]

prepareBinderMessage() 보호된 메소드

protected prepareBinderMessage ( string $id, string $type ) : string[]
$id string
$type string
리턴 string[]

prepareConnectorMessage() 보호된 메소드

protected prepareConnectorMessage ( string $id, string $type ) : string[]
$id string
$type string
리턴 string[]

removeEventListener() 보호된 메소드

protected removeEventListener ( string $event, callable $callback )
$event string
$callback callable

setEventListener() 보호된 메소드

protected setEventListener ( string $event, callable $callback )
$event string
$callback callable

start() 공개 메소드

public start ( $blockEvent = false )

stop() 공개 메소드

public stop ( $blockEvent = false )

unicast() 공개 메소드

public unicast ( $id, $message, $flags = Channel::MODE_STANDARD )

프로퍼티 상세

$connectionPool 보호되어 있는 프로퍼티

protected ConnectionPool,Kraken\Channel\Model\Socket\Connection $connectionPool
리턴 Kraken\Channel\Model\Socket\Connection\ConnectionPool

$endpoint 보호되어 있는 프로퍼티

protected string $endpoint
리턴 string

$flags 보호되어 있는 프로퍼티

protected string[] $flags
리턴 string[]

$frameBuffer 보호되어 있는 프로퍼티

protected string[] $frameBuffer
리턴 string[]

$hosts 보호되어 있는 프로퍼티

protected string[] $hosts
리턴 string[]

$id 보호되어 있는 프로퍼티

protected string $id
리턴 string

$isConnected 보호되어 있는 프로퍼티

protected bool $isConnected
리턴 boolean

$loop 보호되어 있는 프로퍼티

protected LoopInterface,Kraken\Loop $loop
리턴 Kraken\Loop\LoopInterface

$offlineBuffer 보호되어 있는 프로퍼티

protected Buffer,Kraken\Channel\Model\Socket\Buffer $offlineBuffer
리턴 Kraken\Channel\Model\Socket\Buffer\Buffer

$onlineBuffer 보호되어 있는 프로퍼티

protected Buffer,Kraken\Channel\Model\Socket\Buffer $onlineBuffer
리턴 Kraken\Channel\Model\Socket\Buffer\Buffer

$options 보호되어 있는 프로퍼티

protected mixed[] $options
리턴 mixed[]

$socket 보호되어 있는 프로퍼티

protected SocketInterface,Kraken\Ipc\Socket|SocketListenerInterface,Kraken\Ipc\Socket|null $socket
리턴 Kraken\Ipc\Socket\SocketInterface | Kraken\Ipc\Socket\SocketListenerInterface | null

$type 보호되어 있는 프로퍼티

protected int $type
리턴 integer