Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the receiveTimeout and sendTimeout to infinity with this WCF contact?

I have the following app.config in my Host:

<services>
  <service name="DCC_Service.DCCService" behaviorConfiguration="serviceBehavior">
    <endpoint binding="netNamedPipeBinding" contract="DCC_Service.IDCCService" address="DCCService" />
    <endpoint binding="mexNamedPipeBinding" contract="IMetadataExchange" address="mex" />
    <host>
      <baseAddresses>
        <add baseAddress="net.pipe://localhost/"/>
      </baseAddresses>
    </host>
  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="serviceBehavior">
      <serviceMetadata httpGetEnabled="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

How do I set the netNamedPipeBinding timeouts to infinite aka Timespan.MaxValue?

like image 923
Ryan R Avatar asked May 30 '11 15:05

Ryan R


People also ask

What is ReceiveTimeout in WCF service?

ReceiveTimeout – used by the Service Framework Layer to initialize the session-idle timeout which controls how long a session can be idle before timing out.

What is the default timeout for WCF service?

The most common default timeout values within Archiver are: 2 min for querying the Microsoft SQL Server. 5 min for WCF connections (This is used heavily for internal communication between GFI Archiver's own modules).

What is CloseTimeout in WCF?

OpenTimeout (TimeSpan) the interval of time provided for an open operation to complete including security handshakes (WS-Trust, WS-Secure Conversation etc.). The default is 00:01:00. CloseTimeout (TimeSpan) the interval of time provided for a close operation to complete. The default is 00:01:00.

What is Operationtimeout?

The Operation Time Out setting causes the LCD screen to return to the Home screen after a few minutes of inactivity. This feature is enabled by default, but you can turn it off. Note: This setting can be locked by an administrator.


1 Answers

Use infinite for the various timeout values - close, open, receive, and send. You specify these timeouts in a binding configuration like so.

<bindings>
    <netNamedPipeBinding>
        <binding name="mybinding" closeTimeout="infinite" openTimeout="infinite"
            receiveTimeout="infinite" sendTimeout="infinite" />
    </netNamedPipeBinding>
</bindings>

The bindings section goes at the same level as the services and behaviors sections. The only thing left is to reference the binding configuration in your service endpoint.

<services>
  <service name="DCC_Service.DCCService" behaviorConfiguration="serviceBehavior">
    <endpoint binding="netNamedPipeBinding"
        contract="DCC_Service.IDCCService"
        address="DCCService"
        bindingConfiguration="mybinding"/>         <!-- SEE THIS LINE -->
    <endpoint binding="mexNamedPipeBinding"
        contract="IMetadataExchange"
        address="mex" />
    <host>
      <baseAddresses>
        <add baseAddress="net.pipe://localhost/"/>
      </baseAddresses>
    </host>
  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="serviceBehavior">
      <serviceMetadata httpGetEnabled="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

I don't remember specifically (and I don't have time to look right now), but you may have to put this stuff in your client configuration as well.

like image 75
Matt Davis Avatar answered Oct 10 '22 17:10

Matt Davis