PHP Class Swoole\Client\Stream

Author: hantianfeng
Show file Open project: matyhtf/swoole_framework Class Usage Examples

Public Properties

Property Type Description
$connected boolean 是否已连接
$errCode
$errMsg

Protected Properties

Property Type Description
$fp
$tcp

Public Methods

Method Description
__construct ( $tcp = true )
close ( ) : boolean 关闭socket连接
connect ( $host, $port, float $timeout = 0.1 ) : boolean
getSocket ( ) : mixed
recv ( ) : string
send ( $content ) : integer 发送数据
setTimeout ( float $timeout ) : boolean

Method Details

__construct() public method

public __construct ( $tcp = true )

close() public method

关闭socket连接
public close ( ) : boolean
return boolean

connect() public method

public connect ( $host, $port, float $timeout = 0.1 ) : boolean
$host
$port
$timeout float
return boolean

getSocket() public method

public getSocket ( ) : mixed
return mixed

recv() public method

public recv ( ) : string
return string

send() public method

发送数据
public send ( $content ) : integer
$content
return integer

setTimeout() public method

public setTimeout ( float $timeout ) : boolean
$timeout float
return boolean

Property Details

$connected public property

是否已连接
public bool $connected
return boolean

$errCode public property

public $errCode

$errMsg public property

public $errMsg

$fp protected property

protected $fp

$tcp protected property

protected $tcp