Skip to content

Instantly share code, notes, and snippets.

@joshuacalloway
Created July 31, 2012 05:10
Show Gist options
  • Save joshuacalloway/3213881 to your computer and use it in GitHub Desktop.
Save joshuacalloway/3213881 to your computer and use it in GitHub Desktop.
C# reliable TCP duplex callback
in ou project we use the following Binding and works perfectly.
<netTcpBinding>
<binding name="netTcpBinding"
receiveTimeout="Infinite">
<reliableSession inactivityTimeout="00:00:10"
enabled="true" />
</binding>
</netTcpBinding>
This is equal to the following code
binding.ReliableSession.Enabled = true;
binding.ReliableSession.InactivityTimeout =
TimeSpan.FromSeconds(10);
binding.ReceiveTimeout = TimeSpan.MaxValue;
in ou project we use the following Binding and works perfectly.
<netTcpBinding>
<binding name="netTcpBinding"
receiveTimeout="Infinite">
<reliableSession inactivityTimeout="00:00:10"
enabled="true" />
</binding>
</netTcpBinding>
This is equal to the following code
binding.ReceiveTimeout = TimeSpan.MaxValue;
binding.Security.Mode = SecurityMode.None;
binding.ReliableSession.Enabled = true;
// binding.ReliableSession.InactivityTimeout = TimeSpan.FromSeconds(10);
binding.ReliableSession.InactivityTimeout = TimeSpan.MaxValue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment