Improve network reset

This commit is contained in:
世界
2026-08-30 17:41:43 +08:00
parent 3afd290278
commit e4c8b49eaf
26 changed files with 250 additions and 62 deletions
+11
View File
@@ -67,6 +67,7 @@ import (
var (
_ adapter.OutboundWithPreferredRoutes = (*Endpoint)(nil)
_ adapter.InterfaceUpdateListener = (*Endpoint)(nil)
_ dialer.PacketDialerWithDestination = (*Endpoint)(nil)
_ tun.Port = (*Endpoint)(nil)
)
@@ -687,6 +688,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: