Handle network update callbacks in background

This commit is contained in:
世界
2026-08-30 17:41:46 +08:00
parent cfddedb3da
commit 6720a27109
46 changed files with 382 additions and 134 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ func (i *Inbound) Start(stage adapter.StartStage) error {
return i.listener.Start()
}
func (i *Inbound) InterfaceUpdated() {
func (i *Inbound) InterfaceUpdated(ctx context.Context) {
i.udpNat.Purge()
}
+1 -1
View File
@@ -121,7 +121,7 @@ func (h *Outbound) fetchMyAddresses() {
h.myAddresses.Store(myAddresses)
}
func (h *Outbound) InterfaceUpdated() {
func (h *Outbound) InterfaceUpdated(ctx context.Context) {
h.fetchMyAddresses()
if h.icmpPort != nil {
h.icmpPort.Close()