public class OkHttpClientTransport extends Object implements ClientTransport
ClientTransport implementation.ClientTransport.Listener| Modifier and Type | Field and Description |
|---|---|
static ConnectionSpec |
DEFAULT_CONNECTION_SPEC |
| Modifier and Type | Method and Description |
|---|---|
io.grpc.transport.okhttp.OkHttpClientStream |
newStream(MethodDescriptor<?,?> method,
Metadata.Headers headers,
ClientStreamListener listener)
Creates a new stream for sending messages to the remote end-point.
|
void |
shutdown()
Initiates an orderly shutdown of the transport.
|
void |
start(ClientTransport.Listener listener)
Starts transport.
|
public static final ConnectionSpec DEFAULT_CONNECTION_SPEC
public io.grpc.transport.okhttp.OkHttpClientStream newStream(MethodDescriptor<?,?> method, Metadata.Headers headers, ClientStreamListener listener)
ClientTransport
This method returns immediately and does not wait for any validation of the request. If
creation fails for any reason, ClientStreamListener.closed(io.grpc.Status, io.grpc.Metadata.Trailers) will be called to provide
the error information. Any sent messages for this stream will be buffered until creation has
completed (either successfully or unsuccessfully).
newStream in interface ClientTransportmethod - the descriptor of the remote method to be called for this stream.headers - to send at the beginning of the calllistener - the listener for the newly created stream.public void start(ClientTransport.Listener listener)
ClientTransportlistener until after start()
returns.start in interface ClientTransportlistener - non-null listener of transport eventspublic void shutdown()
ClientTransportClientTransport.Listener.transportShutdown() callback called).shutdown in interface ClientTransport