binding maxRetryCount

 

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=943691&SiteID=1

 ==================================================================================

I add a reliableSessino element in my netTcpBinding. and set it's enabled attribute to "true". After send servial requests to service, I cut the net connection, then I receive severial errors:

1. The open operation did not complete within the allotted timeout of 00:00:00. The time allotted to this operation may have been a protion of a longer timeout.

2.  Could not connect to net.tcp://10.102.13.118:11120/myservice. The connection attempt lasted for a time span of 00:00:00.4218750. TCP error code 10060:

3. The maximum retry count has been exceeded with no response from the remote endpoint. The reliable session was faulted. This is often an indication that the remote endpoint is no longer available.

4. This request operation sent to net.tcp://10.102.13.118:11120/myservice did not receive a reply within the configuraed timeout (00:10:00). The time allotted to this operation may have been a protion of a longer timeout.

5. The inactivity timeout of(00:05:00) has been exceeded.

The second one metioned maximum retry count, where can I set this attribute?

And I've been trying to understand these errors more exactly. Thanks to anyone who helps me understand thess errors better.

--Ray_bihpgh20

====================================================================================

 

First, are you testing across a network boundary, and cutting the network cable? If so, good, because just shutting down the service will not simulate this, and thus the RM session is faulted immediately.

You can set max retry count in a custom binding. Consider this server binding:

<netTcpBinding>

<binding name="netTcpRM">

<reliableSession enabled="true" />

</binding>

</netTcpBinding>

 

The equivalent client binding as a custom binding, with RM settings expanded looks like this... you can customize settings here:

<customBinding>

<binding name="customRM">

<reliableSession maxRetryCount="8" acknowledgementInterval="00:00:00.2000000" flowControlEnabled="true" inactivityTimeout="00:10:00" maxPendingChannels="4" maxTransferWindowSize="8" ordered="true" />

<windowsStreamSecurity/>

<binaryMessageEncoding/>

<tcpTransport/>

</binding>

</customBinding>

 

--Michele Leroux Bustamante

===============================================================================

 

 

All these exceptions are expected if you cut the wire and never reconnect it. Different exceptions get thrown depending on the method that's being invoked and/or the state the channel is currently in.

1. Will be thrown out of Open() if the reliable session couldn't be established (in technical terms, a CreateSequenceResponse was never received). You can increase the amount of time the channel will try with the OpenTimeout - we retry CreateSequence messages every 10 seconds.

2. This would also be thrown out of Open() if the method got this exception out of the transport before getting a chance to throw a TimeoutException.

3. This would be thrown out of Send() if the channel never received an acknowledgement for that message. The channel tried resending the message up to MaxRetryCount times.

4. This would be thrown out of Request() if the SendTimeout was hit before MaxRetryCount.

5. This would be thrown if the InactivityTimeout was hit before the SendTimeout or the MaxRetryCount.

Ondrej

--Ondrej Hrebicek - MSFT

=================================================================================

 

Thank you, that really helped.

If I use netTcpBinding, I can't set maxRetryCount, right? I want to know exactly that if I use netTcpBinding, how many times it will retry sending the message? 8 times?

--Ray_bihpgh20

==================================================================================

 

That's correct. The MaxRetryCount setting is only available on the ReliableSessionBindingElement, which means it's accessible through a CustomBinding only. The default value is indeed 8.

--Ondrej Hrebicek - MSFT

 

posted @ 2008-08-29 16:25  IamV  阅读(1623)  评论(0编辑  收藏  举报