\Thrift\TransportTCurlClient

HTTP client for Thrift

Summary

Methods
Properties
Constants
isOpen()
open()
close()
read()
readAll()
write()
flush()
__construct()
setTimeoutSecs()
closeCurlHandle()
No public properties found
No constants found
No protected methods found
$host_
$port_
$uri_
$scheme_
$request_
$response_
$timeout_
N/A
No private methods found
$curlHandle
N/A

Properties

$host_

$host_ : string

The host to connect to

Type

string

$port_

$port_ : integer

The port to connect on

Type

integer

$uri_

$uri_ : string

The URI to request

Type

string

$scheme_

$scheme_ : string

The scheme to use for the request, i.e. http, https

Type

string

$request_

$request_ : string

Buffer for the HTTP request data

Type

string

$response_

$response_ : \Thrift\Transport\binary

Buffer for the HTTP response data.

Type

\Thrift\Transport\binary — string

$timeout_

$timeout_ : float

Read timeout

Type

float

$curlHandle

$curlHandle : 

Type

Methods

isOpen()

isOpen() : boolean

Whether this transport is open.

Returns

boolean —

true if open

open()

open() 

Open the transport for reading/writing

Throws

\Thrift\Exception\TTransportException

if cannot open

close()

close() 

Close the transport.

read()

read(integer  $len) : string

Read some data into the array.

Parameters

integer $len

How much to read

Throws

\Thrift\Exception\TTransportException

if cannot read any more data

Returns

string —

The data that has been read

readAll()

readAll(  $len) : string

Guarantees that the full amount of data is read.

Parameters

$len

Throws

\Thrift\Transport\TTransportException

if cannot read data

Returns

string —

The data, of exact length

write()

write(string  $buf) 

Writes some data into the pending buffer

Parameters

string $buf

The data to write

Throws

\Thrift\Exception\TTransportException

if writing fails

flush()

flush() 

Opens and sends the actual request over the HTTP connection

Throws

\Thrift\Exception\TTransportException

if a writing error occurs

__construct()

__construct(string  $host, integer  $port = 80, string  $uri = '',   $scheme = 'http') 

Make a new HTTP client.

Parameters

string $host
integer $port
string $uri
$scheme

setTimeoutSecs()

setTimeoutSecs(float  $timeout) 

Set read timeout

Parameters

float $timeout

closeCurlHandle()

closeCurlHandle()