lrstanley / girc

:bomb: girc is a flexible IRC library for Go :ok_hand:
https://pkg.go.dev/github.com/lrstanley/girc
MIT License
137 stars 13 forks source link

Make PING timeout configurable #57

Closed nmeum closed 1 year ago

nmeum commented 1 year ago

πŸš€ Changes proposed by this PR

This commit allows configuring the interval at which girc will drop the connection after not receiving a PONG response to an outstanding PING. Presently, this is hardcoded to PINGDelay + 60s and can thus not be configured.

🧰 Type of change

πŸ“ Notes to reviewer

If my understanding of the code base is correct then PINGTimeout must always be larger then PINGDelay. This is currently only mentioned in the documentation comment but not otherwise enforced. If this is deemed important then I see two potential solutions: (1) Emit an error if this invariant is not satisfied (2) Define PINGTimeout as an offset on PINGDelay.

🀝 Requirements

codecov-commenter commented 1 year ago

Codecov Report

Merging #57 (2c1c277) into master (8240917) will increase coverage by 0.05%. The diff coverage is 60.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   55.39%   55.45%   +0.05%     
==========================================
  Files          13       13              
  Lines        3264     3266       +2     
==========================================
+ Hits         1808     1811       +3     
+ Misses       1343     1342       -1     
  Partials      113      113              
Impacted Files Coverage Ξ”
conn.go 53.80% <0.00%> (+0.14%) :arrow_up:
client.go 63.18% <100.00%> (+0.29%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

nmeum commented 1 year ago

Thanks for your quick feedback. I hope I have made appropriate changes to accommodate it.