TClientBase

Thrift service client, which implements an interface by synchronously calling a server over a TProtocol.

TClientBase simply extends Interface with generic input/output protocol properties to serve as a supertype for all TClients for the same service, which might be instantiated with different concrete protocol types (there is no covariance for template type parameters). If Interface is derived from another interface BaseInterface, it also extends TClientBase!BaseInterface.

TClient is the class that actually implements TClientBase. Just as TClientBase, it is also derived from TClient!BaseInterface for inheriting services.

TClient takes two optional template arguments which can be used for specifying the actual TProtocol implementation used for optimization purposes, as virtual calls can completely be eliminated then. If OutputProtocol is not specified, it is assumed to be the same as InputProtocol. The protocol properties defined by TClientBase are exposed with their concrete type (return type covariance).

In addition to implementing TClientBase!Interface, TClient offers the following constructors:

this(InputProtocol iprot, OutputProtocol oprot);
// Only if is(InputProtocol == OutputProtocol), to use the same protocol
// for both input and output:
this(InputProtocol prot);

The sequence id of the method calls starts at zero and is automatically incremented.

Members

Functions

inputProtocol
TProtocol inputProtocol()

The input protocol used by the client.

outputProtocol
TProtocol outputProtocol()

The output protocol used by the client.

Meta