-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass on supported gun opts in connect() #230
base: master
Are you sure you want to change the base?
Conversation
Hi Ulf, Thanks a lot for your contribution, could you please fix the Travis complains? after that I will merge it for sure! thanks |
Just in case, @uwiger … the error that travis reports is:
It's an Elivs error that, unless you can abstract that code into something else that makes sense (probably not), you can "fix" by increasing |
@elbrujohalcon feels like cheating, but you're right - I couldn't easily come up with a refactoring that wouldn't be less readable than the existing code. :) |
Codecov Report
@@ Coverage Diff @@
## master #230 +/- ##
==========================================
- Coverage 87.55% 86.99% -0.57%
==========================================
Files 7 7
Lines 217 223 +6
==========================================
+ Hits 190 194 +4
- Misses 27 29 +2
Continue to review full report at Codecov.
|
BTW, I noticed issue #205, which has been around for a while. Since |
As I understand it, the code coverage is reduced due to the changes related to the proxy setup. There don't seem to be any proxy-related test cases in the connection_SUITE. |
Since dialyzer run on the test code complained, I moved the gun options under a separate options key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I guess we can safely ignore codecov… right, @ferigis? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, we will fix the coverage later
How did you get to a keepalive value of 10000? Trial and error? I'm looking into increasing the default to something more reasonable. |
I only used 10 seconds in the test suite. I assumed that we might want to set the value to something much higher, but it's surprisingly hard to find some recommendation on the subject. I found this article, which admittedly talks about a device being connected to APNS, but it makes sense that Apple shouldn't force mobile, battery-powered devices to ping at intervals of a few seconds.
there is of course also this...:
|
Thanks. I think the biggest improvement would be to make Gun NOT send the PING if there's been traffic sent or received in that time period. Then maybe set it to 1 minute by default, since there is no real power constraint. So Gun would by default send PING 1 minute after any data was sent or received. To be honest there probably aren't too many people with mostly idle connections, so it might not make sense for it to be enabled by default. Not having it enabled would help avoid certain issues like |
Is this not merged solely due to Travis CI complaints? Or is there something else missing? I read the whole thread and this seems good to go. |
This change allows users to pass on options supported by
gun
in aconnect()
call.For example, this means that you can use alternative TLS port 2197 without
gun
guessing that you want TCP transport (addtransport => tls
), and you can set a longerkeepalive
than the default 5 seconds.