Improve network reset

This commit is contained in:
世界
2026-07-19 17:50:02 +08:00
parent 552994b6ca
commit d2e030bdca
26 changed files with 256 additions and 68 deletions
+11
View File
@@ -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: