twitchyliquid64 / subnet

Simple, auditable & elegant VPN, built with TLS mutual authentication and TUN.
MIT License
1.06k stars 79 forks source link

accpet io/timeout err #15

Open Jamlee opened 5 years ago

Jamlee commented 5 years ago

Hi, it is alway say 'accept tcp [::]:9001: i/o timeout', it may be need to check the error type

https://github.com/twitchyliquid64/subnet/blob/e330ba9c6ba7075768de0b8cebe44f58b846f7e6/subnet/server.go#L107-L109

i try to give solution like below:

              if err != nil {
            if !s.isShuttingDown {
                if !err.(net.Error).Timeout() {
                    log.Infof("Listener err: %s", err.Error())
                }
            }
        } else {
            s.handleClient(conn)
        }