mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-10-06 12:09:07 +00:00
The changes reorganize the network client code by splitting it into focused modules for better maintainability, including
21 lines
399 B
Go
21 lines
399 B
Go
package client
|
|
|
|
import "time"
|
|
|
|
// startConnectionMonitoring monitors connection health and logs status
|
|
func (c *Client) startConnectionMonitoring() {
|
|
go func() {
|
|
ticker := time.NewTicker(30 * time.Second)
|
|
defer ticker.Stop()
|
|
|
|
for range ticker.C {
|
|
if !c.isConnected() {
|
|
return
|
|
}
|
|
|
|
// Only touch network to detect issues; avoid noisy logs
|
|
_ = c.host.Network().Peers()
|
|
}
|
|
}()
|
|
}
|