Class StreamSocketConnection
The default implementation of the ConnectionInterface using stream socket
resources.
-
PHPFastCGI\FastCGIDaemon\Connection\StreamSocketConnection
implements
PHPFastCGI\FastCGIDaemon\Connection\ConnectionInterface
Methods summary
public
|
#
__construct( resource $socket )
Constructor.
Parameters
- $socket
- The stream socket to wrap
|
protected
PHPFastCGI\FastCGIDaemon\Exception\ConnectionException
|
#
createExceptionFromLastError( string $function )
Creates a formatted exception from the last error that occurecd.
Creates a formatted exception from the last error that occurecd.
Parameters
- $function
- The function that failed
Returns
|
public
string
|
#
read( integer $length )
Read data from the connection.
Read data from the connection.
Parameters
- $length
- Number of bytes to read
Returns
string Buffer containing the read data
Throws
Implementation of
|
public
|
#
write( string $buffer )
Write data to the connection.
Write data to the connection.
Parameters
- $buffer
- Buffer containing the data to write
Throws
Implementation of
|
public
boolean
|
#
isClosed( )
Tests to see if the connection has been closed.
Tests to see if the connection has been closed.
Returns
boolean True if the connection has been closed, false otherwise
Implementation of
|
public
|
#
close( )
Closes the connection it from the pool.
Closes the connection it from the pool.
Implementation of
|