Fix wireguard reconnect

This commit is contained in:
世界 2022-09-06 00:11:43 +08:00
parent 1b091c9b07
commit 8f8437a88d
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -275,6 +275,7 @@ func (c *wireClientBind) Open(port uint16) (fns []conn.ReceiveFunc, actualPort u
func (c *wireClientBind) receive(b []byte) (n int, ep conn.Endpoint, err error) {
udpConn, err := c.connect()
if err != nil {
err = &wireError{err}
return
}
n, err = udpConn.Read(b)
@ -332,10 +333,6 @@ func (w *wireError) Temporary() bool {
return true
}
func (w *wireError) Unwrap() error {
return w.cause
}
type wireConn struct {
net.Conn
access sync.Mutex