Class AbstractClientStream.TransportState
java.lang.Object
io.grpc.internal.AbstractStream.TransportState
io.grpc.internal.AbstractClientStream.TransportState
- All Implemented Interfaces:
io.grpc.internal.ApplicationThreadDeframerListener.TransportExecutor, MessageDeframer.Listener
- Direct Known Subclasses:
Http2ClientStreamTransportState
- Enclosing class:
AbstractClientStream
protected abstract static class AbstractClientStream.TransportState
extends AbstractStream.TransportState
This should only be called from the transport thread.
-
Field Summary
Fields inherited from class AbstractStream.TransportState
DEFAULT_ONREADY_THRESHOLD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, CallOptions options) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeframerClosed(boolean hasPartialMessage) Called when the deframer closes.protected voidProcesses the contents of a received data frame from the server.protected voidinboundHeadersReceived(Metadata headers) Called by transport implementations when they receive headers.protected voidinboundTrailersReceived(Metadata trailers, Status status) Processes the trailers and status from the server.protected final booleanprotected final ClientStreamListenerlistener()Override this method to provide a stream listener.final voidsetListener(ClientStreamListener listener) final voidtransportReportStatus(Status status, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported.final voidtransportReportStatus(Status status, ClientStreamListener.RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported.Methods inherited from class AbstractStream.TransportState
closeDeframer, deframe, getStatsTraceContext, getTransportTracer, isStreamDeallocated, messagesAvailable, onSentBytes, onStreamAllocated, onStreamDeallocated, requestMessagesFromDeframerForTesting, setDecompressor, setFullStreamDecompressorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.grpc.internal.ApplicationThreadDeframerListener.TransportExecutor
runOnTransportThreadMethods inherited from interface MessageDeframer.Listener
bytesRead, deframeFailed
-
Constructor Details
-
TransportState
protected TransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, CallOptions options)
-
-
Method Details
-
setListener
-
deframerClosed
public void deframerClosed(boolean hasPartialMessage) Description copied from interface:MessageDeframer.ListenerCalled when the deframer closes.- Parameters:
hasPartialMessage- whether the deframer contained an incomplete message at closing.
-
listener
Description copied from class:AbstractStream.TransportStateOverride this method to provide a stream listener.- Specified by:
listenerin classAbstractStream.TransportState
-
isOutboundClosed
protected final boolean isOutboundClosed() -
inboundHeadersReceived
Called by transport implementations when they receive headers.- Parameters:
headers- the parsed headers
-
inboundDataReceived
Processes the contents of a received data frame from the server.- Parameters:
frame- the received data frame. Its ownership is transferred to this method.
-
inboundTrailersReceived
-
transportReportStatus
Report stream closure with status to the application layer if not already reported. This method must be called from the transport thread.- Parameters:
status- the new status to setstopDelivery- iftrue, interrupts any further delivery of inbound messages that may already be queued up in the deframer. Iffalse, the listener will be notified immediately after all currently completed messages in the deframer have been delivered to the application.trailers- new instance ofTrailers, either empty or those returned by the server
-
transportReportStatus
public final void transportReportStatus(Status status, ClientStreamListener.RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported. This method must be called from the transport thread.- Parameters:
status- the new status to setrpcProgress- RPC progress that theClientStreamListener.closed(Status, RpcProgress, Metadata)will receivestopDelivery- iftrue, interrupts any further delivery of inbound messages that may already be queued up in the deframer and overrides any previously queued status. Iffalse, the listener will be notified immediately after all currently completed messages in the deframer have been delivered to the application.trailers- new instance ofTrailers, either empty or those returned by the server
-