Skip to content

Commit 0036d1d

Browse files
committed
Update main.go
1 parent 5056f3d commit 0036d1d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

wap/cmd/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,19 @@ func main() {
394394
// Give the hotspot some time to initialize
395395
log.Info("Waiting for hotspot to initialize...")
396396
time.Sleep(5 * time.Second)
397+
398+
// Restart the server to bind to the new hotspot interface
399+
serverMutex.Lock()
400+
if currentServer != nil {
401+
currentServer.Close()
402+
currentServer = nil
403+
}
404+
serverMutex.Unlock()
405+
406+
// Signal to start a new server
407+
go func() {
408+
connectedCh <- false
409+
}()
397410
}
398411

399412
break loop2

0 commit comments

Comments
 (0)