Still getting KeepAlive problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JayBee
    Junior Member
    • Oct 2010
    • 114

    #1

    Still getting KeepAlive problems

    My JSON requests all have timeouts.

    To make sure I am keeping the session alive I am calling KeepAlive every minute and yet I still get an application crash everyday.

    A first chance exception of type 'System.Net.WebException' occurred in System.dll
    An unhandled exception of type 'System.Net.WebException' occurred in System.dll
    Additional information: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

    This one was after 4 hours and 50 minutes. I am not hammering the servers. Just asking for data once a minute for all races and runners, best three prices and all traded volume.

    I am using VB.NET

    This gets on my thrupenny bits.
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    This is a "standard" error that can happen at any time when trying to communicate over a network.

    I'm not saying that it isn't Betfair's fault, just that these things can happen so you need to handle it in your code.

    It's not difficult to trap an exception and just re-request the data.

    Comment

    • JayBee
      Junior Member
      • Oct 2010
      • 114

      #3
      Thanks. I understand but I have Try/Catch everywhere and never get the printout from my Catch.

      I'll just have to shove some more in.

      Comment

      • Mr Magoo
        Junior Member
        • Jan 2011
        • 86

        #4
        The problem here is a clash in terminology. Betfair's KeepAlive() API call is unrelated to the error you are getting, which is about HTTP Keep-Alive connections. The two are not related.

        HTTP Keep-Alives are when a web browser (or an API client) makes a new HTTP request on a previously-used TCP connection. The 'error' you are getting is that the web server (Betfair's API server, in this case) had closed the connection. This is common practice, it's not an error. You just have to retry the request.

        Comment

        Working...
        X