locked
Avoiding the timeout for the StreamingSubscriptionConnection RRS feed

  • Question

  • Hello , 
    Simply I am having problems because of getting timeout for the StreamingSubscriptionConnection after 30 mins, many people suggesting to open the connection again, but one I do that ... and if I stopped the connection intentionally and open it again manually (after the first time out) , I am receiving an error about "there is another connection open against the subscription" and with the exception the subscriptions are get disposed. 
    Do you have any idea of why this is happening? 

    My Idea is to avoid having the timeout , I thought in the beginning that receiving notification might restart the timeout again, but it does not. 
    So does anyone know how to refresh the timeout so I wont get the onDisconnect event ? 
    Saturday, November 17, 2012 10:31 PM

All replies

  • Glen Scales has an excellent series on using the EWS Managed API with Powershell.

    In this post

    http://gsexdev.blogspot.co.uk/2012/05/ews-managed-api-and-powershell-how-to_28.html#!/2012/05/ews-managed-api-and-powershell-how-to_28.html

    he discusses notificiations, and at the bottom shows a method for registering an event that will automatically re-open the connection when it gets closed.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Saturday, November 17, 2012 10:43 PM
  • Hello , Thanks for the reply , but actually I am reOpening the connection from the C# code, but that generates problems later if I the connection got closed and opened later. So is there difference between the two ways ? because both of them are using the EWS API . 
    Monday, November 19, 2012 11:32 AM
  • Glen's method uses the onDisconnect event to trigger a re-connect immediately so you never lose the connection. I cannot say exactly what the difference is.  The timeout value is fixed, and as far as I know there is no way to avoid having it time out.  You just have to deal with the fact that it is going to time out.

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Monday, November 19, 2012 11:58 AM