Freigeben über


How to change WCF session time out value?

You have to increase binding receive timeout, binding receive timeout is responsible for session time out.

Example:

SERVICE CONFIG:

 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

    <system.serviceModel>

        <bindings>

            <netTcpBinding>

                <binding name="NetTcp_Reliable" receiveTimeout="00:20:00">

                    <reliableSession ordered="false" inactivityTimeout="00:01:00"

                        enabled="true" />

                </binding>

            </netTcpBinding>

        </bindings>

        <behaviors>

            <serviceBehaviors>

                <behavior name="MetadataBehavior">

                    <serviceMetadata httpGetEnabled="true" httpGetUrl="https://localhost:2526/Service" />

                </behavior>

            </serviceBehaviors>

        </behaviors>

        <services>

            <service behaviorConfiguration="MetadataBehavior" name="Service.ServiceImplementation">

                <endpoint address="net.tcp://localhost:2525/Service" binding="netTcpBinding"

                    bindingConfiguration="NetTcp_Reliable" contract="Service.IServiceContract" />

            </service>

        </services>

    </system.serviceModel>

</configuration>

NOTE:

Reliable session inactivity timeout useful when you are not able to send the message because of some network problems, how long we have to retry to send this message.

Comments