Property | Type | Description | |
---|---|---|---|
$connected | boolean | Note, the connection may not be ready to use, but the socket is connected at least. See $handshaked, and other properties in subclasses. | |
$context | Stream context | ||
$firstRead | boolean | Whether the current read is the first one to the socket | |
$name | string | The socket name according to stream_socket_get_name | |
$socket | resource |
Method | Description | |
---|---|---|
disconnect ( ) : void | Disconnect the socket | |
getIp ( ) : string | Gets the IP address of the socket | |
getLastError ( ) : integer | string | Get the last error that occurred on the socket | |
getNamePart ( string $name, $part ) : string | Gets part of the name of the socket | |
getPort ( ) : string | Gets the port of the socket | |
getResource ( ) | ||
getResourceId ( ) | ||
isConnected ( ) : boolean | Whether the socket is currently connected | |
receive ( integer $length = self::DEFAULT_RECEIVE_LENGTH ) : string | Receive data from the socket | |
send ( string $data ) : boolean | integer |
Method | Description | |
---|---|---|
configure ( array $options ) : void | Configure options | |
getName ( ) : string | Gets the name of the socket |
public getLastError ( ) : integer | string | ||
return | integer | string |
public static getNamePart ( string $name, $part ) : string | ||
$name | string | (from $this->getName() usually) |
return | string |
public isConnected ( ) : boolean | ||
return | boolean |
protected bool $connected | ||
return | boolean |
protected bool $firstRead | ||
return | boolean |
protected string $name | ||
return | string |