Skip to content

Commit

Permalink
close listener
Browse files Browse the repository at this point in the history
  • Loading branch information
liujianping committed Jul 26, 2019
1 parent 606167b commit 4cd99a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (srv *Server) Serve(ctx context.Context) error {
return ctx.Err()
case <-srv.closed:
log.Println("tcpserver is closing ...")
return nil
return ln.Close()
default:
con, err := ln.Accept()
if err != nil {
Expand Down

0 comments on commit 4cd99a2

Please sign in to comment.