My application has to components, one service (running as system) and one client (running in user space). Both are communicating by using WFC (localhost) and the communication works just fine, until I hibernate and resume the machine. Since that moment, the method that I use as heartbeat is throwing a timeout exception with the following content
The message could not be transferred within the allotted timeout of 00:01:00. There was no space available in the reliable channel's transfer window. The time allotted to this operation may have been a portion of a longer timeout.
I am checking the connection status and is not faulted. Luckily, after 10 minutes of "inactivity" in the connection, another timeout expires (10 minutes) changing the connection status to Faulted. In that moment my client detects the new status and is able to restart the connection.
My server has the following config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding openTimeout="00:00:05"
closeTimeout="00:00:05"
sendTimeout="00:00:03"
receiveTimeout="00:01:00">
<security mode="Message" >
<message clientCredentialType="Windows"/>
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="EEAS.Kiosk.WcfService">
<endpoint address="" binding="wsDualHttpBinding" contract="EEAS.Kiosk.IWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/KioskService/WcfService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
And my client has the following config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IWcfService" />
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8733/KioskService/WcfService/"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IWcfService"
contract="KioskWcf.IWcfService" name="WSDualHttpBinding_IWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
my service interface
[ServiceContract(CallbackContract = typeof(IWcfServiceCallback))]
public interface IWcfService
{
[OperationContract]
void OpenSession();
[OperationContract]
CompositeType OpenSessionWithMessage();
[OperationContract]
bool isAlive();
[OperationContract]
void TemporarySuspension();
}
and the callback interface
public interface IWcfServiceCallback
{
[OperationContract]
bool IsAlive();
[OperationContract]
void SuspensionFinished();
[OperationContract]
bool UIMessageOnCallback(CompositeType UIMessage);
}
Any idea? my only solution is try to reduce that 10 minutes timeout to the minimum so the faulted connection is quickly detected and restarted. far from perfect :/
It does not appear that the current scenario requires duplex binding. If using duplex mode communication, please apply one-way communication to ensure that the client or server will not time out.
Besides, if the server and the client are not the same machines, please supply windows credentials on the client-side while calling the service.
Feel free to let me know if the problem still exists.