Skip to content

Commit

Permalink
Re-register proxy on local address change event from libp2p host
Browse files Browse the repository at this point in the history
- Subscribe to local address update events from libp2p host
- On address change, shut down the existing mDNS server and re-register with updated address
  • Loading branch information
MOHANKUMAR-IT committed Dec 9, 2024
1 parent 767a2c4 commit e73024f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p2p/discovery/mdns/mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ func (s *mdnsService) Start() error {
return err
}
go func() {
defer ipEvt.Close()
defer func() {
if err := ipEvt.Close(); err != nil {
log.Errorf("failed to close ipEvt: %s", err)
}
}()
var addrUpdateDebounce sync.Once
for {
select {
Expand Down

0 comments on commit e73024f

Please sign in to comment.