add ftcp listener

This commit is contained in:
ginuerzh
2021-04-12 23:35:57 +08:00
parent cf340f457e
commit a4e2886826
4 changed files with 306 additions and 1 deletions

View File

@ -72,7 +72,12 @@ func (l *Listener) Accept() (conn net.Conn, err error) {
}
func (l *Listener) Close() error {
return l.conn.Close()
err := l.conn.Close()
l.connPool.Range(func(k interface{}, v *serverConn) bool {
v.Close()
return true
})
return err
}
func (l *Listener) Addr() net.Addr {