What 130 second timeout is killing my WCF streaming service call?

前端 未结 5 846
一向
一向 2020-12-08 16:22

Just recently I started to investigate a tricky problem with WCF streaming in which a CommunicationException is produced if the client waits for any longer than 130 seconds

5条回答
  •  时光取名叫无心
    2020-12-08 17:11

    Judging from the error:

    The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '23:59:59.9110000'

    Looks like this is a simple TCP timeout.

    You can verify it by running the application as self-hosted, and then running this command in console:

    netstat -no |find "xxxxx"
    

    where xxxxx is the PID of your server process. This command will show you the connections your server has established and refresh every second.

    Try to connect with the client and see what happens. Most likely, you'll see "CLOSE_WAIT" or "TIME_WAIT" on your connection after around 100-120 seconds - which will mean it was aborted due to timeout.

    This sould be fixable by adding the following to your config:

     
    

    The parameter is explained here

提交回复
热议问题