WCF The request channel timed out attempting to send after xx:xx:xx

月 王 1 Reputation point
2022-09-02T03:15:46.377+00:00

this is my confg on wcf server
<bindings>
<netTcpBinding>
<binding name="netTcpBindConfig" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" portSharingEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
this is my config

<bindings>
<netTcpBinding>
<binding name="netTcpBindConfig" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" portSharingEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
This issue occurs in production environment,I cannot reproduce this error. If I set a sleep time such as 40 * 60 * 1000 (40min) in wcf server method.
public List<CompositeType> GetData(List<CompositeType> value)
{

        List<CompositeType> list = new List<CompositeType>();  
        try  
        {  
             
            Thread.Sleep(40 * 60 * 1000);  
        }  
        catch (Exception ex)  
        {  
  
        }  
        return list;  
    }  

then i can get this error:The request channel timed out while waiting for a reply after xx:xx:xx.
they are different.
my error likes a particular call is not finished in a given time interval.
how can i reproduce this error: The request channel timed out attempting to send after xx:xx:xx
thanks a lot!

Developer technologies | .NET | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-09-02T10:11:27.813+00:00

    Hi @月 王 ,

    If you want to reproduce this error, you can try removing all the timeout values and using the sleep method to get the error.

    To fix this error, you need to add a timeout parameter to both the server and the client. Or you can use the following methods to see what's going on:

    1. Try throttling in WCF services. eg: Try increasing concurrent sessions. Take a look WCF Throttling.
    2. Make sure that no session remains there, you could try using PerCall rather than Using Sessions here. You can follow the code below in your interface to remove session:

    [ServiceContract(Namespace="YOUR OWN NAMESPACE", SessionMode=SessionMode.NotAllowed)]

    and your contract classes implementing those interface :

    ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]

    And then you know what's going on.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. 月 王 1 Reputation point
    2022-09-29T00:01:43.11+00:00

    i would like to get error "The request channel timed out attempting to send after xx:xx:xx". Not "while waiting for a reply".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.