Свойство | Тип | Описание | |
---|---|---|---|
$defaultMaxSendBufferSize | integer | Default send buffer size. | |
$id | integer | Connection->id. | |
$maxPackageSize | integer | Maximum acceptable packet size. | |
$maxSendBufferSize | integer | OnBufferFull callback will be emited When the send buffer is full. | |
$onBufferDrain | callback | Emitted when the send buffer becomes empty. | |
$onBufferFull | callback | Emitted when the send buffer becomes full. | |
$onClose | callback | Emitted when the other end of the socket sends a FIN packet. | |
$onError | callback | Emitted when an error occurs with connection. | |
$onMessage | callback | Emitted when data is received. | |
$protocol | Workerman\Protocols\ProtocolInterface | The format is like this Workerman\\Protocols\\Http. | |
$worker | Which worker belong to. |
Свойство | Тип | Описание | |
---|---|---|---|
$_currentPackageLength | integer | Current package length. | |
$_id | integer | A copy of $worker->id which used to clean up the connection in worker->connections | |
$_idRecorder | integer | Id recorder. | |
$_isPaused | boolean | Is paused. | |
$_recvBuffer | string | Receive buffer. | |
$_remoteAddress | string | Remote address. | |
$_sendBuffer | string | Send buffer. | |
$_socket | resource | Socket | |
$_status | integer | Connection status. |
Метод | Описание | |
---|---|---|
__construct ( resource $socket, string $remote_address = '' ) | Construct. | |
__destruct ( ) : void | Destruct. | |
baseRead ( resource $socket, boolean $check_eof = true ) : void | Base read handler. | |
baseWrite ( ) : void | boolean | Base write handler. | |
close ( mixed $data = null, boolean $raw = false ) : void | Close connection. | |
consumeRecvBuffer ( integer $length ) : void | Remove $length of data from receive buffer. | |
destroy ( ) : void | Destroy connection. | |
getRemoteIp ( ) : string | Get remote IP. | |
getRemotePort ( ) : integer | Get remote port. | |
getSocket ( ) : resource | Get the real socket. | |
pauseRecv ( ) : void | Pauses the reading of data. That is onMessage will not be emitted. Useful to throttle back an upload. | |
pipe ( |
This method pulls all the data out of a readable stream, and writes it to the supplied destination. | |
resumeRecv ( ) : void | Resumes reading after a call to pauseRecv. | |
send ( string $send_buffer, boolean $raw = false ) : void | boolean | null | Sends data on the connection. |
Метод | Описание | |
---|---|---|
bufferIsFull ( ) : boolean | Whether send buffer is full. | |
checkBufferWillFull ( ) : void | Check whether the send buffer will be full. |
public __construct ( resource $socket, string $remote_address = '' ) | ||
$socket | resource | |
$remote_address | string |
protected bufferIsFull ( ) : boolean | ||
Результат | boolean |
protected checkBufferWillFull ( ) : void | ||
Результат | void |
public consumeRecvBuffer ( integer $length ) : void | ||
$length | integer | |
Результат | void |
public getRemotePort ( ) : integer | ||
Результат | integer |
public resumeRecv ( ) : void | ||
Результат | void |
protected int $_currentPackageLength | ||
Результат | integer |
protected int $_id | ||
Результат | integer |
protected static int $_idRecorder | ||
Результат | integer |
protected string $_remoteAddress | ||
Результат | string |
public static int $defaultMaxSendBufferSize | ||
Результат | integer |
public static int $maxPackageSize | ||
Результат | integer |
public int $maxSendBufferSize | ||
Результат | integer |
public callback $onBufferDrain | ||
Результат | callback |
public callback $onBufferFull | ||
Результат | callback |
public callback $onClose | ||
Результат | callback |
public callback $onError | ||
Результат | callback |
public callback $onMessage | ||
Результат | callback |
public ProtocolInterface,Workerman\Protocols $protocol | ||
Результат | Workerman\Protocols\ProtocolInterface |