Tworzę aplikację do czatu z WCF (za pomocą umowy zwrotnej) i netTcpBinding. Hostuję usługę jako usługę Windows i uzyskuję dostęp do niej z innych komputerów za pośrednictwem aplikacji klienckiej.Usługa oddzwaniania WCF z netTcp Limit czasu wiązania po 10 minutach
Problem, z którym teraz borykam się, polega na tym, że połączenie klientów przechodzi do stanu błędu po 10 minut, co wydaje się być pewnego rodzaju przekroczeniem limitu czasu. Próbowałem już zwiększyć otrzymany limit czasu i wysłać limit czasu w usłudze i kliencie, ale nie działał.
które ustawienie należy zmienić, aby zwiększyć ten limit czasu, w jakiej aplikacji, usłudze lub kliencie?
obserwuję moje pliki konfiguracyjne,
serwisowe
<system.serviceModel>
<services>
<service behaviorConfiguration="PeerTalk.Service.ChatServiceBehavior"
name="PeerTalk.Service.ChatService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="PeerTalk.Service.ServiceContracts.IChat">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:7920/ChatService" />
<add baseAddress="net.tcp://localhost:7921/ChatService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="PeerTalk.Service.ChatServiceBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="tcpBinding"
maxBufferSize="67108864"
maxReceivedMessageSize="67108864"
maxBufferPoolSize="67108864"
transferMode="Buffered"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:00:10"
sendTimeout="00:00:10"
maxConnections="100">
<readerQuotas maxDepth="64"
maxStringContentLength="67108864"
maxArrayLength="67108864"
maxBytesPerRead="67108864"
maxNameTableCharCount="16384"/>
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows"/>
</security>
<reliableSession enabled="false" inactivityTimeout="00:01:00"/>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
Client
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IChat" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:00:10" transactionFlow="false"
transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="67108864"
maxBufferSize="67108864" maxConnections="10" maxReceivedMessageSize="67108864">
<readerQuotas maxDepth="32" maxStringContentLength="67108864"
maxArrayLength="67108864" maxBytesPerRead="67108864" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:01:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://10.10.10.45:7921/ChatService" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IChat" contract="PeerTalkService.IChat"
name="NetTcpBinding_IChat">
</endpoint>
</client>
</system.serviceModel>
Dzięki.
próbowałeś ustawienie ReceiveTimeout -1. http://msdn.microsoft.com/en-us/library/ms824661.aspx. o nazwie infinity –
spróbuj także http://nogeekhere.blogspot.com/2009/04/why-will-wcf-client-be-disconnected.html –
Dzięki Shoaib, próbowałem używać nieskończonej ilości, ale nie akceptowałem jako prawidłowej wartość w pliku konfiguracyjnym. z jakiegokolwiek powodu? w dowolny sposób, zrobiłem małe obejście, aby usługa odświeżyła każdego klienta co 5 minut. Sądzę jednak, że powinien istnieć sposób na poradzenie sobie z tym poprzez konfiguracje. – user501579