diff options
| author | citrons <citrons@mondecitronne.com> | 2025-06-05 14:58:13 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-06-07 16:02:18 -0500 |
| commit | 768fc1782ad4aefeb6ace455b3a74b42832e17e3 (patch) | |
| tree | f412a2b0807bf6aad8417e49ff6fb33bdcfdb29d /client | |
| parent | 4e46b6cad58b6a4f0e9235a267c817e239b42334 (diff) | |
randomize reconnect time
Diffstat (limited to 'client')
| -rw-r--r-- | client/client/client.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/client/client.go b/client/client/client.go index 0b24175..2d47ded 100644 --- a/client/client/client.go +++ b/client/client/client.go @@ -5,6 +5,7 @@ import ( "net" "time" "bufio" + "math/rand" ) type MessageHandler interface { @@ -56,7 +57,7 @@ func (c *Client) RunClient() { continue } defer conn.Close() - sleep = time.Second + sleep = time.Second / time.Duration(2 + rand.Int() % 4) recv, recvErr := proto.ReadLines(bufio.NewReader(conn)) send := make(chan proto.Line, 1) |
