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

Method close

okhttp/src/main/java/io/grpc/okhttp/AsyncSink.java:190–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

188 }
189
190 @Override
191 public void close() {
192 if (closed) {
193 return;
194 }
195 closed = true;
196 serializingExecutor.execute(new Runnable() {
197 @Override
198 public void run() {
199 try {
200 if (sink != null && buffer.size() > 0) {
201 sink.write(buffer, buffer.size());
202 }
203 } catch (IOException e) {
204 transportExceptionHandler.onException(e);
205 }
206 buffer.close();
207 try {
208 if (sink != null) {
209 sink.close();
210 }
211 } catch (IOException e) {
212 transportExceptionHandler.onException(e);
213 }
214 try {
215 if (socket != null) {
216 socket.close();
217 }
218 } catch (IOException e) {
219 transportExceptionHandler.onException(e);
220 }
221 }
222 });
223 }
224
225 private abstract class WriteRunnable implements Runnable {
226 @Override

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected