-
Notifications
You must be signed in to change notification settings - Fork 41
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
Client disconnects if different KeepAliveInterval is set #179
Comments
Hmmm, something is wrong with ping mechanism in 0.6.3. If there is only one client everything is fine, I cannot see any If both clients are not sending any messages (only ping messages are exchanging) everything is fine. But when one client is sending messages other client will disconnect every 30s. For example: Client2 log:
If I start third client (Python client 0.9.5) it will behave correctly and will not disconnect. Any idea what is wrong with ping mechanism? |
I tried to find a source of this problem and found out the following: Line 80 in e607000
But no matter if Line 113 in e607000
But it should not execute.... right? |
I found solution for this problem: #180 If Client1 is sending messages and Client2 is just listening for messages, Client2 will not send ping after |
Hello, I agree I had the same issue and apply the same fix. |
It seems to me that these are different timeoutTicker instances. Both server and client are using them.
This "solves" the problem, yes. But only because the select case for keepAliveTicker is executing even the timeoutTicker has elapsed. IMHO, the real problem is that the client does not reset its own timeout when it sends a Ping. You may have noticed that it is not the server which is closing the connection. It is the client! |
Yes, these are different timeoutTicker instances. There is a new instance for every new client connected. Client1 - Sends message every 2s Client2 successfully receives messages that Client1 is sending but Client2 will not send pings if Client1 is emitting messages. The main source of this problem is that Client2 stops sending ping messages. But if I implement timer as described in #180 everything starts behaving normally.
I tried implementing server and clients using your fix and I can confirm that it works too. Client2 will not get disconnected if Client1 is sending messages. Line 115 in 729f03b
Client stops sending pings but client will not be disconnected by server as server resets timeoutTicker when sending ping to the client.
For me this approach is acceptable. I hope there are no cons for using this ping mechanism. |
Fixed by #181 |
I'm using the latest release (0.6.3) for my client and server. I defined the following values for both, server and client:
With these parameters I can see that client disconnects/reconnects every 30 seconds.
This is client log:
This is server log:
The only solution I found is to set
KeepAliveInterval=5s
on the server. If I try to set it to 4s or 6s it will still cause client to disconnect.Any idea what is causing these issues?
btw, in comments I see this
signalr/options.go
Line 39 in e607000
But in
newPartyBase
method I see this hardcoded:signalr/party.go
Line 62 in e607000
Could this cause any issues?
The text was updated successfully, but these errors were encountered: