我在主機下面的app.config:如何設置的receiveTimeout和的SendTimeout到無窮大與此WCF接觸?
<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>
如何設置netNamedPipeBinding超時爲無窮又名Timespan.MaxValue
?
感謝馬特。我將以下內容添加到我的客戶端:'NetNamedPipeBinding binding = new NetNamedPipeBinding(); binding.SendTimeout = TimeSpan.MaxValue; binding.ReceiveTimeout = TimeSpan.MaxValue;'然後在實例化我的雙工通道工廠時使用該綁定。 – 2011-05-30 16:15:04
我添加了' ... '但是VS是強調每個'「無限」'藍色值與無效的參數消息。例如'的\'openTimeout \'屬性無效 - 值\'無限\'根據其數據類型\'字符串\'是無效的 - 該模式的約束failed.' –
2011-05-30 16:21:59
我相信這是一個Visual Studio神器。在運行時使用「無限」字符串可以正確處理。在這裏看到了答案:http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/46f9f3ad-da26-493d-9743-895ee9bd4c61/ – 2011-05-30 16:28:21