mirror of https://github.com/grpc/grpc-java.git
parent
5e6078594b
commit
ada32b0cb1
|
|
@ -238,11 +238,14 @@ public final class ChannelImpl implements Channel {
|
||||||
private class CallImpl<ReqT, RespT> extends Call<ReqT, RespT> {
|
private class CallImpl<ReqT, RespT> extends Call<ReqT, RespT> {
|
||||||
private final MethodDescriptor<ReqT, RespT> method;
|
private final MethodDescriptor<ReqT, RespT> method;
|
||||||
private final SerializingExecutor callExecutor;
|
private final SerializingExecutor callExecutor;
|
||||||
|
private final boolean unaryRequest;
|
||||||
private ClientStream stream;
|
private ClientStream stream;
|
||||||
|
|
||||||
public CallImpl(MethodDescriptor<ReqT, RespT> method, SerializingExecutor executor) {
|
public CallImpl(MethodDescriptor<ReqT, RespT> method, SerializingExecutor executor) {
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.callExecutor = executor;
|
this.callExecutor = executor;
|
||||||
|
this.unaryRequest = method.getType() == MethodType.UNARY
|
||||||
|
|| method.getType() == MethodType.SERVER_STREAMING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -308,7 +311,12 @@ public final class ChannelImpl implements Channel {
|
||||||
cancel();
|
cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream.flush();
|
// For unary requests, we don't flush since we know that halfClose should be coming soon. This
|
||||||
|
// allows us to piggy-back the END_STREAM=true on the last payload frame without opening the
|
||||||
|
// possibility of broken applications forgetting to call halfClose without noticing.
|
||||||
|
if (!unaryRequest) {
|
||||||
|
stream.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ClientStreamListenerImpl implements ClientStreamListener {
|
private class ClientStreamListenerImpl implements ClientStreamListener {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue