rename packetHandlerMap.Close() to Destroy()

This commit is contained in:
Marten Seemann
2020-01-22 17:59:22 +07:00
parent 62d3a4166a
commit db396d8a78
6 changed files with 24 additions and 23 deletions

View File

@@ -33,7 +33,7 @@ type unknownPacketHandler interface {
}
type packetHandlerManager interface {
io.Closer
Destroy() error
SetServer(unknownPacketHandler)
CloseServer()
sessionRunner
@@ -305,7 +305,7 @@ func (s *baseServer) Close() error {
// If the server was started with ListenAddr, we created the packet conn.
// We need to close it in order to make the go routine reading from that conn return.
if s.createdPacketConn {
err = s.sessionHandler.Close()
err = s.sessionHandler.Destroy()
}
s.closed = true
close(s.errorChan)