none
net tcp streaming timeout when sending an 8mb payload RRS feed

  • Question

  • service is self hosted, nettcp
    all communication is done with streaming, both client requests and service responses
    100 or so clients state side, network local, work fine
    when a client runs from off site, either vpn in the states, or on the network but overseas, the streaming works until an 8mb payload is requested
    the server gets the request, and starts the response with the opened 8mb file
    the socket then gets closed

    server side wcf trace, i find this;
    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 '00:02:00'.

    at the service app.config i have the SendTimeout at 00:10:00
    what do i need to increase, to get a longer timeout period, ie at least a minute?
    there are various timeout settings, but i cant see one that looks like its going to help.

    server config

    <?xml version="1.0"?>
    <configuration>
    <system.serviceModel>
    <bindings>
    <customBinding>
    <binding name="CustomTCPStream"
    closeTimeout="00:01:00"
    openTimeout="00:01:00"
    receiveTimeout="00:10:00"
    sendTimeout="00:10:00">
    <binaryMessageEncoding />
    <tcpTransport maxBufferPoolSize="524288" maxReceivedMessageSize="134217728" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="65536" maxPendingConnections="256" channelInitializationTimeout="00:10:00"
    transferMode="Streamed" listenBacklog="256" portSharingEnabled="false" teredoEnabled="false"
    />
              <security mode="None" />
    </binding>
    </customBinding>
    <netTcpBinding>
    <binding name="TCPStreamBinding" sendTimeout="00:10:00" transferMode="Streamed"
    listenBacklog="256" maxConnections="256" maxReceivedMessageSize="134217728">
    <security mode="None">
    <transport clientCredentialType="None" protectionLevel="None" />
    <message clientCredentialType="None" />
    </security>
    </binding>
    </netTcpBinding>
    </bindings>
    <behaviors>
    <serviceBehaviors>
    <behavior name="TCPStreamBehavior">
    <serviceDebug includeExceptionDetailInFaults="true" />
    <serviceThrottling maxConcurrentCalls="256" maxConcurrentSessions="256"
    maxConcurrentInstances="256" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    <services>
    <service behaviorConfiguration="TCPStreamBehavior" name="WCFService.WCFService">
    <endpoint address="TCPStream" binding="customBinding" bindingConfiguration="CustomTCPStream"
    name="TCPStream" contract="WCFService.ITCPStream" />
    <host>
    <baseAddresses>
    <add baseAddress="net.tcp://localhost:24000/Server/" />
    </baseAddresses>
    </host>
    </service>
    </services>
    </system.serviceModel>
    </configuration>


     





    Wednesday, September 23, 2015 7:04 PM

Answers

  • thanks for the reply btw -

    following your advice, ive added a custom binding to the config, and updated my original post

    i havent deployed it yet, can you advise me on available timeout settings in the custom binding?

    They seem hard to pin down, exactly what settings are available and what they control

    You'll have to play with it to determine what is the best time that meets your needs, like keep increasing it until it doesn't timeout. :)
    Friday, September 25, 2015 6:50 PM

All replies

  • at the service app.config i have the SendTimeout at 00:10:00
    what do i need to increase, to get a longer timeout period, ie at least a minute?
    there are various timeout settings, but i cant see one that looks like its going to help.

    On the service side config, you have to use a Custom Binding to override any default settings. You can change defaults in the client side config the way you are doing it in your example, but you can't do the same thing on the service side config. You have to override on the service config by using a Custom Binding and point to it.  

    There are other examples on how to use Custom Bindings by using Bing or Google.

    http://robbincremers.me/2012/01/01/wcf-custom-binding-by-configuration-and-by-binding-standardbindingelement-and-standardbindingcollectionelement/

    Wednesday, September 23, 2015 8:08 PM
  • thanks - i didnt have the complete server.config in,  so i edited and put it in
    you can see im using the netTCPStreamBinding, which works fine in thousands of other connections
    some overseas, many using vpn through the internet

    Wednesday, September 23, 2015 8:23 PM
  • thanks for the reply btw -

    following your advice, ive added a custom binding to the config, and updated my original post

    i havent deployed it yet, can you advise me on available timeout settings in the custom binding?

    They seem hard to pin down, exactly what settings are available and what they control

    Friday, September 25, 2015 6:26 PM
  • thanks for the reply btw -

    following your advice, ive added a custom binding to the config, and updated my original post

    i havent deployed it yet, can you advise me on available timeout settings in the custom binding?

    They seem hard to pin down, exactly what settings are available and what they control

    You'll have to play with it to determine what is the best time that meets your needs, like keep increasing it until it doesn't timeout. :)
    Friday, September 25, 2015 6:50 PM