Close the tunnel listener when the tunnel is cloed.

This commit is contained in:
Milos Gajdos
2019-08-08 15:20:53 +01:00
parent c7e8a2aeb9
commit 9eb45dac82
3 changed files with 10 additions and 0 deletions

View File

@@ -418,6 +418,8 @@ func (t *tun) Listen(addr string) (Listener, error) {
accept: make(chan *socket, 128),
// the channel to close
closed: make(chan bool),
// tunnel closed channel
tunClosed: t.closed,
// the connection
conn: c,
// the listener socket