Reputation: 4112
In SignalR (1.2.2), What is the difference between a KeepAlive and ConnectionTimeout?
With a keep alive actively pinging the server, the connection will never timeout. So what is the point of ConnectionTimeout?
Am I confusing ConnectionTimeout with a timeout associated while establishing a new connection?
Upvotes: 3
Views: 10223
Reputation: 2448
KeepAlive also means that you have an opened resource - connection. CPU is used to handle it each 10 seconds for instance. KeepAlive will just don't let server to drop it saying smth like "Yes, I'm small and slow, but I'm still alive and send you packages".
ConnectionTimeout could be the same, untill reconnect. And reconnect may not happen. After timeout the resource will be closed (connection) and reopened. ConnectionTimeout will be like "Ok, give me 110 seconds and I'll decide what to do during this period. After timeout we can talk again if required".
Upvotes: 1
Reputation: 3238
ConnectionTimeout
This setting represents the amount of time to leave a transport connection open and waiting for a response before closing it and opening a new connection. The default value is 110 seconds.
KeepAlive
This setting represents the amount of time to wait before sending a keepalive packet over an idle connection. The default value is 10 seconds. This value must not be more than 1/3 of the DisconnectTimeout value.
Upvotes: 1
Reputation: 4112
I found the answer on the wiki shortly after posting the question. Pretty much ConnectionTimeout has no effect when a KeepAlive is set.
ConnectionTimeout - Represents the amount of time to leave a connection open before timing out. Default is 110 seconds.
KeepAlive - Representing the amount of time to wait before sending a keep alive packet over an idle connection. Set to null to disable keep alive. This is set to 30 seconds by default. When this is on, the ConnectionTimeout will have no effect.
Upvotes: 6