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

Method close

core/src/main/java/io/grpc/internal/MessageFramer.java:327–338  ·  view source on GitHub ↗

Flushes and closes the framer and releases any buffers. After the framer is closed or disposed, additional calls to this method will have no affect.

()

Source from the content-addressed store, hash-verified

325 * disposed, additional calls to this method will have no affect.
326 */
327 @Override
328 public void close() {
329 if (!isClosed()) {
330 closed = true;
331 // With the current code we don't expect readableBytes > 0 to be possible here, added
332 // defensively to prevent buffer leak issues if the framer code changes later.
333 if (buffer != null && buffer.readableBytes() == 0) {
334 releaseBuffer();
335 }
336 commitToSink(true, true);
337 }
338 }
339
340 /**
341 * Closes the framer and releases any buffers, but does not flush. After the framer is

Callers 1

grpcFrameMethod · 0.95

Calls 4

isClosedMethod · 0.95
releaseBufferMethod · 0.95
commitToSinkMethod · 0.95
readableBytesMethod · 0.65

Tested by 1

grpcFrameMethod · 0.76