lnobad / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

"KeepAliveDelay" and "PingFrequency" inconsistency #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'll illustrate this inconsistency by code.

// --- cut here ---
var config = new NetPeerConfiguration("SomeId")
    {
        PingFrequency = 6.0f, // same as default value
        KeepAliveDelay = 4.0f, // same as default value
    };
var Client = new NetClient(config);
Client.Start();
// --- cut here ---

I expect that code will compile and run because KeepAliveDelay is shorter than 
PingFrequency (as in xml documentation "Gets or sets the number of seconds of 
inactivity before sending an extra ping packet as keepalive. This should be 
shorter than ping interval").
Instead I get exception: "Setting KeepAliveDelay to lower than ping frequency 
doesn't make sense!"

I'm using code from "lidgren-network-gen3-2010-06-22.zip" archive.

Original issue reported on code.google.com by barlog.t...@gmail.com on 24 Jun 2010 at 9:41

GoogleCodeExporter commented 9 years ago
Good catch. Actually it turned out KeepAliveDelay is mostly redundant 
information - I removed it in revision 58. Ping frequency is used instead.

Original comment by lidg...@gmail.com on 24 Jun 2010 at 11:24