PHP Class Resque\Socket\Client

Author: Michael Haynes ([email protected])
显示文件 Open project: mjphaynes/php-resque Class Usage Examples

Protected Properties

Property Type Description
$hostname string The client's hostname, as seen by the server. This variable is only set after calling lookup_hostname, as hostname lookups can take up a decent amount of time.
$ip The client's IP address, as seen by the server
$port If given, this will hold the port associated to address
$socket The client's socket resource, for sending and receiving data with

Public Methods

Method Description
__construct ( resource &$socket ) Creates the client
__toString ( ) : string String representation of the client
disconnect ( ) Closes the socket
getHostname ( ) : string Gets the IP hostname
getSocket ( ) : socket Returns this clients socket

Method Details

__construct() public method

Creates the client
public __construct ( resource &$socket )
$socket resource The resource of the socket the client is connecting by, generally the master socket.

__toString() public method

String representation of the client
public __toString ( ) : string
return string

disconnect() public method

Closes the socket
public disconnect ( )

getHostname() public method

Gets the IP hostname
public getHostname ( ) : string
return string

getSocket() public method

Returns this clients socket
public getSocket ( ) : socket
return socket

Property Details

$hostname protected_oe property

The client's hostname, as seen by the server. This variable is only set after calling lookup_hostname, as hostname lookups can take up a decent amount of time.
protected string $hostname
return string

$ip protected_oe property

The client's IP address, as seen by the server
protected $ip

$port protected_oe property

If given, this will hold the port associated to address
protected $port

$socket protected_oe property

The client's socket resource, for sending and receiving data with
protected $socket