PHP 클래스 PHPDaemon\Network\Connection

저자: Vasily Zorin ([email protected])
상속: extends IOStream
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$addr Address
$allowselfsigned Allow self-signed?
$bevConnectEnabled Enable bevConnect?
$certfile Certificate file
$connected Connected?
$contextCache Context cache
$contextCacheSize Context cache size
$dgram Dgram connection?
$failed Failed?
$host Hostname
$hostReal Real host
$keepalive Keepalive?
$locAddr Local address
$locPort Local port
$onConnected Stack of callbacks called when connection is established
$parentSocket Parent socket
$passphrase Passphrase
$password Password
$path Path
$pkfile Private key file
$port Port number
$scheme Scheme
$timeout Timeout
$type Type
$uri URI information
$user User name
$verifypeer Verify peer?

공개 메소드들

메소드 설명
__destruct ( ) : void Destructor
__get ( string $name ) : mixed Getter
close ( ) : void Close the connection
connect ( string $url, callable $cb = null ) : boolean Connects to URL
connectRaw ( string $host ) : boolean Establish raw socket connection
connectTcp ( string $host, integer $port ) : boolean Establish TCP connection
connectUdp ( string $host, integer $port ) : boolean Establish UDP connection
connectUnix ( string $path ) : boolean Establish UNIX socket connection
getHost ( ) : string Get host
getPort ( ) : integer Get port
getSocketName ( &$addr, &$port ) : void Get socket name
getUrl ( ) : string Get URL
isConnected ( ) : boolean Connected?
onConnected ( callable $cb ) : void Executes the given callback when/if the connection is handshaked
onFailure ( ) : void Called when the connection failed to be established
onFailureEv ( EventBufferEvent $bev = null ) : void Called when the connection failed
onFinish ( ) : void Called when connection finishes
onInheritanceFromRequest ( Request $req ) : void Called if we inherit connection from request
onReady ( ) : void Called when the connection is handshaked (at low-level), and peer is ready to recv. data
onUdpPacket ( object $pct ) : void Called when new UDP packet received
setDgram ( boolean $bool ) : void Sets DGRAM mode
setKeepalive ( boolean $bool ) : void Set keepalive
setOption ( integer $level, integer $optname, mixed $val ) : void Set socket option
setParentSocket ( Generic $sock ) : void Sets parent socket
setPeername ( string $host, integer $port ) : void Sets peer name
setTimeouts ( integer $read, integer $write ) : void Set timeouts
write ( string $data ) : boolean Send data to the connection. Note that it just writes to buffer that flushes at every baseloop

보호된 메소드들

메소드 설명
importParams ( )
initSSLContext ( ) : object | false Initialize SSL context

메소드 상세

__destruct() 공개 메소드

Destructor
public __destruct ( ) : void
리턴 void

__get() 공개 메소드

Getter
public __get ( string $name ) : mixed
$name string Name
리턴 mixed

close() 공개 메소드

Close the connection
public close ( ) : void
리턴 void

connect() 공개 메소드

Connects to URL
public connect ( string $url, callable $cb = null ) : boolean
$url string URL
$cb callable Callback
리턴 boolean Success

connectRaw() 공개 메소드

Establish raw socket connection
public connectRaw ( string $host ) : boolean
$host string Hostname
리턴 boolean Success

connectTcp() 공개 메소드

Establish TCP connection
public connectTcp ( string $host, integer $port ) : boolean
$host string Hostname
$port integer Port
리턴 boolean Success

connectUdp() 공개 메소드

Establish UDP connection
public connectUdp ( string $host, integer $port ) : boolean
$host string Hostname
$port integer Port
리턴 boolean Success

connectUnix() 공개 메소드

Establish UNIX socket connection
public connectUnix ( string $path ) : boolean
$path string Path
리턴 boolean Success

getHost() 공개 메소드

Get host
public getHost ( ) : string
리턴 string

getPort() 공개 메소드

Get port
public getPort ( ) : integer
리턴 integer

getSocketName() 공개 메소드

Get socket name
public getSocketName ( &$addr, &$port ) : void
리턴 void

getUrl() 공개 메소드

Get URL
public getUrl ( ) : string
리턴 string

importParams() 보호된 메소드

protected importParams ( )

initSSLContext() 보호된 메소드

Initialize SSL context
protected initSSLContext ( ) : object | false
리턴 object | false Context

isConnected() 공개 메소드

Connected?
public isConnected ( ) : boolean
리턴 boolean

onConnected() 공개 메소드

Executes the given callback when/if the connection is handshaked
public onConnected ( callable $cb ) : void
$cb callable Callback
리턴 void

onFailure() 공개 메소드

Called when the connection failed to be established
public onFailure ( ) : void
리턴 void

onFailureEv() 공개 메소드

Called when the connection failed
public onFailureEv ( EventBufferEvent $bev = null ) : void
$bev EventBufferEvent
리턴 void

onFinish() 공개 메소드

Called when connection finishes
public onFinish ( ) : void
리턴 void

onInheritanceFromRequest() 공개 메소드

Called if we inherit connection from request
public onInheritanceFromRequest ( Request $req ) : void
$req Request Parent Request
리턴 void

onReady() 공개 메소드

Called when the connection is handshaked (at low-level), and peer is ready to recv. data
public onReady ( ) : void
리턴 void

onUdpPacket() 공개 메소드

Called when new UDP packet received
public onUdpPacket ( object $pct ) : void
$pct object Packet
리턴 void

setDgram() 공개 메소드

Sets DGRAM mode
public setDgram ( boolean $bool ) : void
$bool boolean DGRAM Mode
리턴 void

setKeepalive() 공개 메소드

Set keepalive
public setKeepalive ( boolean $bool ) : void
$bool boolean
리턴 void

setOption() 공개 메소드

Set socket option
public setOption ( integer $level, integer $optname, mixed $val ) : void
$level integer Level
$optname integer Option
$val mixed Value
리턴 void

setParentSocket() 공개 메소드

Sets parent socket
public setParentSocket ( Generic $sock ) : void
$sock PHPDaemon\BoundSocket\Generic
리턴 void

setPeername() 공개 메소드

Sets peer name
public setPeername ( string $host, integer $port ) : void
$host string Hostname
$port integer Port
리턴 void

setTimeouts() 공개 메소드

Set timeouts
public setTimeouts ( integer $read, integer $write ) : void
$read integer Read timeout in seconds
$write integer Write timeout in seconds
리턴 void

write() 공개 메소드

Send data to the connection. Note that it just writes to buffer that flushes at every baseloop
public write ( string $data ) : boolean
$data string Data to send
리턴 boolean Success

프로퍼티 상세

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

Address
protected $addr

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

Allow self-signed?
protected $allowselfsigned

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

Enable bevConnect?
protected $bevConnectEnabled

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

Certificate file
protected $certfile

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

Connected?
protected $connected

$contextCache 보호되어 있는 정적으로 프로퍼티

Context cache
protected static $contextCache

$contextCacheSize 보호되어 있는 정적으로 프로퍼티

Context cache size
protected static $contextCacheSize

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

Dgram connection?
protected $dgram

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

Failed?
protected $failed

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

Hostname
protected $host

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

Real host
protected $hostReal

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

Keepalive?
protected $keepalive

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

Local address
protected $locAddr

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

Local port
protected $locPort

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

Stack of callbacks called when connection is established
protected $onConnected

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

Parent socket
protected $parentSocket

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

Passphrase
protected $passphrase

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

Password
protected $password

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

Path
protected $path

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

Private key file
protected $pkfile

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

Port number
protected $port

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

Scheme
protected $scheme

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

Timeout
protected $timeout

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

Type
protected $type

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

URI information
protected $uri

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

User name
protected $user

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

Verify peer?
protected $verifypeer