remove Session.Close()

Session.Close() sends a transport-level error code. Applications should
not be able to call this function, but use CloseWithError() instead.
This commit is contained in:
Marten Seemann
2020-01-22 20:53:01 +07:00
parent a5120204cc
commit a93e544c94
29 changed files with 101 additions and 123 deletions

View File

@@ -135,7 +135,7 @@ func (h *packetHandlerMap) ReplaceWithClosed(id protocol.ConnectionID, handler p
time.AfterFunc(h.deleteRetiredSessionsAfter, func() {
h.mutex.Lock()
handler.Close()
handler.shutdown()
delete(h.handlers, string(id))
h.mutex.Unlock()
})
@@ -175,8 +175,8 @@ func (h *packetHandlerMap) CloseServer() {
if handler.getPerspective() == protocol.PerspectiveServer {
wg.Add(1)
go func(handler packetHandler) {
// session.Close() blocks until the CONNECTION_CLOSE has been sent and the run-loop has stopped
_ = handler.Close()
// blocks until the CONNECTION_CLOSE has been sent and the run-loop has stopped
handler.shutdown()
wg.Done()
}(handler)
}