MCPcopy Create free account
hub / github.com/grpc/grpc-java / canSend

Method canSend

binder/src/main/java/io/grpc/binder/internal/Outbound.java:170–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168 }
169
170 @GuardedBy("this")
171 private final boolean canSend() {
172 switch (outboundState) {
173 case INITIAL:
174 if (!prefixReady) {
175 return false;
176 }
177 break;
178 case PREFIX_SENT:
179 // We can only send something if we have messages or the suffix.
180 // Note that if we have the suffix but no messages in this state, it means we've been closed
181 // early.
182 if (!messageAvailable() && !suffixReady) {
183 return false;
184 }
185 break;
186 case ALL_MESSAGES_SENT:
187 if (!suffixReady) {
188 return false;
189 }
190 break;
191 default:
192 return false;
193 }
194 return isReady();
195 }
196
197 final boolean isReady() {
198 return transport.isReady();

Callers 1

sendMethod · 0.95

Calls 2

messageAvailableMethod · 0.95
isReadyMethod · 0.95

Tested by

no test coverage detected