Improve network reset
This commit is contained in:
@@ -68,6 +68,7 @@ import (
|
||||
|
||||
var (
|
||||
_ adapter.OutboundWithPreferredRoutes = (*Endpoint)(nil)
|
||||
_ adapter.InterfaceUpdateListener = (*Endpoint)(nil)
|
||||
_ dialer.PacketDialerWithDestination = (*Endpoint)(nil)
|
||||
_ tun.Port = (*Endpoint)(nil)
|
||||
)
|
||||
@@ -696,6 +697,16 @@ func (t *Endpoint) Close() error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (t *Endpoint) InterfaceUpdated() {
|
||||
if !t.started.Load() {
|
||||
return
|
||||
}
|
||||
netMon, loaded := t.server.Sys().NetMon.GetOK()
|
||||
if loaded && netMon != nil {
|
||||
netMon.InjectEvent()
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Endpoint) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error) {
|
||||
switch network {
|
||||
case N.NetworkTCP:
|
||||
|
||||
Reference in New Issue
Block a user