SocketTransport

Implements \Joomla\CMS\Http\TransportInterface

HTTP transport class for using sockets directly.

since

1.7.3

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options) 
since

1.7.3

throws

\RuntimeException

Arguments

$options

\Joomla\Registry\RegistryClient options object.

connect

Method to connect to a server and get the resource.

connect(\Joomla\CMS\Uri\Uri $uri, integer $timeout = null) : resource
since

1.7.3

throws

\RuntimeException

Arguments

$uri

\Joomla\CMS\Uri\UriThe URI to connect with.

$timeout

integerRead timeout in seconds.

Response

resourceSocket connection resource.

getResponse

Method to get a response object from a server response.

getResponse(string $content) : \Joomla\CMS\Http\Response
since

1.7.3

throws

\UnexpectedValueException

Arguments

$content

stringThe complete server response, including headers.

Response

\Joomla\CMS\Http\Response

isSupported

Method to check if http transport socket available for use

isSupported() : boolean
static
since

3.0.0

Response

booleanTrue if available else false

request

Send a request to the server and return a HttpResponse object with the response.

request(string $method, \Joomla\CMS\Uri\Uri $uri, mixed $data = null, array $headers = null, integer $timeout = null, string $userAgent = null) : \Joomla\CMS\Http\Response
since

1.7.3

throws

\RuntimeException

Arguments

$method

stringThe HTTP method for sending the request.

$uri

\Joomla\CMS\Uri\UriThe URI to the resource to request.

$data

mixedEither an associative array or a string to be sent with the request.

$headers

arrayAn array of request headers to send with the request.

$timeout

integerRead timeout in seconds.

$userAgent

stringThe optional user agent string to send with the request.

Response

\Joomla\CMS\Http\Response

Properties

connections

Reusable socket connections.

since

1.7.3

Type(s)

array

options

The client options.

since

1.7.3

Type(s)

\Joomla\Registry\Registry