WCF - Binding.ReceiveTimeout & ReliableSession.InactivityTimeout

I am trying to make a WCF service that uses callbacks for a client. I would like the channel to be open while there is a connection (Internet, network), and either the client or the channel obviously did not close the channel.

To open the channel (even without activity), I found reliable sessions that WCF supports. I see that using reliable sessions, there are two timers that need to be considered: Binding.ReceiveTimeout and ReliableSession.InactivityTimeout .

After searching the Internet, I still can't figure out exactly how the two work together. I know that if one of two times, the connection goes into an error state.

My first question is: what exactly happens when trusted sessions are allowed?

My second question: Here , why does msdn say the following?

Since the connection is disconnected if the inactivity timer is triggered, increasing InactivityTimeout when it is larger than ReceiveTimeout has no effect. The default value for both of these timeouts is 10 minutes, so you always need to increment both of them in order to make a difference when using a reliable session.

+4
source share
1 answer

To get the answer to your first question, take a look at the good answer to this question:

What is the purpose of a reliable WCF session?

To my explanation on msdn, it’s clear: When the time specified in ReceiveTimeout (for example, 10 minutes) is reached, it will terminate the connection even if a reliable session continues (for example, every 1 minute).

A constant wait is sent every minute to make sure that inactivity (for example, 5 minutes) will never be reached, so the channel will open indefinitely, but after the time specified in ReceiveTimeout, the session / channel will still be closed.

So ReceiveTimeout should always be higher or equal to inactivityTimeout, as I understand it.

+1
source

Source: https://habr.com/ru/post/1439533/


All Articles