MCPcopy Create free account
hub / github.com/e2wugui/zeze / close

Method close

ZezeJava/ZezeJava/src/main/java/Zeze/Netty/HttpServer.java:323–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321 }
322
323 @Override
324 public void close() {
325 lock();
326 try {
327 task11Executor.shutdown(true);
328 if (scheduler == null)
329 return;
330 Netty.logger.info("close {}", getClass().getName());
331 scheduler.cancel(true);
332 scheduler = null;
333 exchanges.values().forEach(HttpExchange::closeConnectionNow);
334 exchanges.clear();
335 if (channelFuture != null) {
336 var ch = channelFuture.channel();
337 channelFuture = null;
338 if (ch != null)
339 ch.close();
340 }
341 if (httpSession != null)
342 httpSession.stop();
343 } finally {
344 unlock();
345 }
346 }
347
348 // 这是一个低开销的检测空闲超时的方法,不准确但只会比预设的超时时间长,写超时可能会多出readIdleTimeout的时长
349 protected void checkTimeout(@NotNull Channel channel) {

Callers 1

StopMethod · 0.95

Calls 11

lockMethod · 0.95
unlockMethod · 0.95
channelMethod · 0.80
getNameMethod · 0.65
cancelMethod · 0.65
valuesMethod · 0.65
clearMethod · 0.65
closeMethod · 0.65
stopMethod · 0.65
shutdownMethod · 0.45
forEachMethod · 0.45

Tested by 1

StopMethod · 0.76