tags:

views:

238

answers:

1

Hi, when do reliable sessions time out?

My session class is defined as follows:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]

and in my app.config...

<bindings>
      <netTcpBinding>
        <binding name="FTS_netTcpBinding">
          <reliableSession enabled="true" inactivityTimeout="00:00:30"/>          
        </binding>        
      </netTcpBinding>           
    </bindings>

I have put a timer in the constructor of my session class that simply outputs a count (1..2..3...) to the console for every second the session is active.

I have tested it so far by faulting my channel. I would have imagined that the session class would have died after ~30 seconds (as specified in my inactivityTimeout parameter) and hence the timer would have died. However it was still going after a minute.

Each session on my app will have significant resources so I need to make sure that they are cleaned up when something goes wrong.

Thanks.

+1  A: 

I now believe that the session will time out after the ReceiveTimeOut has elapsed. That is the session instance has not received any data for that amount of time.

RemotecUk

related questions