Changing the timeouts for WCF services

  • Thread starter Thread starter Andrew Falanga
  • Start date Start date
A

Andrew Falanga

Hi,

I'm writing a WCF server/client system based on TCP (and I believe the
http protocol but that's only a guess). At any rate, I'm to the point
of debugging what's there and the system works except one of the
Operation Contract function takes too long to exit (it's executing
mstest and it's taking quite a while, longer than the default 1 minute
timeout). Is changing the timeouts as simple as changing it in the
App.config files I was told to generate using that svcutil program at
MSDN?

Thanks,
Andy
 
I think you need to adjust the Binding (remembering that WCF is a
combination of
A
B
C

Address
Binding
Contract


Here is a named pipe binding example:


<netNamedPipeBinding>
<binding name="NamedPipeBindingName1"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="9000000"
maxConnections="500"
maxReceivedMessageSize="9000000"
receiveTimeout="00:20:00"
transactionFlow="false">
<security mode="Transport">
</security>
</binding>
</netNamedPipeBinding>


http://msdn.microsoft.com/en-us/library/ms731291.aspx

receiveTimeout
A TimeSpan value that specifies the interval of time provided for a
receive operation to complete. This value should be greater than or equal to
Zero. The default is 00:10:00.

sendTimeout
A TimeSpan value that specifies the interval of time provided for a
send operation to complete. This value should be greater than or equal to
Zero. The default is 00:01:00.



Most people use a different binding, so you'll have to research.


I also suggest Juval Lowy's book on WCF Services.
http://www.amazon.com/Programming-WCF-Services-Juval-Lowy/dp/0596526997
 
Back
Top