42wim/matterircd

Handshake timeout too short on slow/high-latency connections

Closed this issue · 0 comments

On very high-latency connections, the 10-second timeout for handshaking is too short and the connection attempt will fail (this was observed over a satellite connection with 3-4 second round-trip times and an available bandwidth of ~ 2400 baud). As a stopgap, I have applied the following patch, but it might be better if this were configurable or a more intelligent approach is used to pick the timeout (don't know what that would be though).

diff --git a/mm-go-irckit/server.go b/mm-go-irckit/server.go
index 9cc26f3..4e7ee44 100644
--- a/mm-go-irckit/server.go
+++ b/mm-go-irckit/server.go
@@ -478,7 +478,7 @@ outerloop:
                        }
 
                        return err
-               case <-time.After(10 * time.Second):
+               case <-time.After(90 * time.Second):
                        return ErrHandshakeFailed
                }
        }