2015-09-04 3 views
0

У меня есть служба Windows хостинг WCF, с сконфигурировано его привязки следующим образом:Отменено сообщение об ошибке в службе WCF

<bindings> 
    <netTcpBinding> 
    <binding name="BindingReliableMessaging" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"/> 
     <reliableSession enabled="true" inactivityTimeout="23:59:59"/> 
    </binding> 
    </netTcpBinding> 
</bindings> 

клиент, который соединяется имеет такое же связывание с ним.

Я использую метод подписки, чтобы отправить сообщение, это это широковещательный код:

public void NotifyServer(EventDataType eventData) 
    { 
     lock (locker) 
     {     
      var inactiveClients = new List<string>(); 

      // Broadcast to all the clients bar the one sending it 
      // 
      foreach (var client in clients) 
      { 

       if (client.Key != eventData.ClientName) 
       { 
        try 
        { 
         // Send the message to the current client 
         // 
         client.Value.BroadcastToClient(eventData); 
        } 
        catch (Exception) 
        { 
         // If we can't access the current clients callback method, 
         // we add them to the inactive clients list, as they've probably lost their connection. 
         // 
         inactiveClients.Add(client.Key); 
        } 
       } 
      } 

      if (inactiveClients.Count > 0) 
      { 
       // Remove any clients that we couldn't get to 
       // 
       foreach (var client in inactiveClients) 
       { 
        clients.Remove(client); 
       } 
      } 
     } 
    } 

Это используется уже в течение довольно продолжительного времени, только в последнее время сообщения отправляются получили больше (теперь о 113K), и я получаю следующее сообщение об ошибке:

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Aborted. 

у меня есть размеры все максимизированы, а также тайм-ауты и клиенты не высадили. Любые предложения относительно причины?

Роб

Как просил, вот конфигурационные файлы:

Клиентские

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" /> 
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 
     <section name="ARIA.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </sectionGroup> 
    </configSections> 
    <log4net> 
    <root> 
     <level value="DEBUG" /> 
     <appender-ref ref="LogFileAppender" /> 
    </root> 
    <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> 
     <param name="File" value="AriaClient.Log" /> 
     <param name="AppendToFile" value="true" /> 
     <lockingModel type="log4net.Appender.FileAppender+InterProcessLock" /> 
     <rollingStyle value="Size" /> 
     <maxSizeRollBackups value="20" /> 
     <maximumFileSize value="1MB" /> 
     <staticLogFileName value="true" /> 
     <layout type="log4net.Layout.PatternLayout"> 
     <param name="ConversionPattern" value="%date (#%property{pid}) [%thread] %-5level %logger - %message%newline" /> 
     </layout> 
    </appender> 
    </log4net> 
    <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> 
    </startup> 
    <system.serviceModel> 
    <bindings> 
     <netTcpBinding> 
     <binding name="NetTcpBinding_IBroadcasterService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"/> 
      <reliableSession enabled="true" inactivityTimeout="23:59:59"/> 
     </binding> 
     <binding name="NetTcpBinding_IMathsEngineService"> 
      <reliableSession enabled="true" /> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
    <client> 
     <endpoint address="net.tcp://MARSH:8080/MetricBroadcast" binding="netTcpBinding" 
     bindingConfiguration="NetTcpBinding_IBroadcasterService" contract="MetricBroadcast.IBroadcasterService" 
     name="NetTcpBinding_IBroadcasterService"> 
     <identity> 
      <userPrincipalName value="[email protected]" /> 
     </identity> 
     </endpoint> 
     <endpoint address="net.tcp://MARSH:8088/MathsEngine" binding="netTcpBinding" 
     bindingConfiguration="NetTcpBinding_IMathsEngineService" contract="MathsEngineService.IMathsEngineService" 
     name="NetTcpBinding_IMathsEngineService"> 
     <identity> 
      <userPrincipalName value="[email protected]" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 
    <connectionStrings> 
    <add name="AriaEntities" connectionString="metadata=res://*/Model.Aria.csdl|res://*/Model.Aria.ssdl|res://*/Model.Aria.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=MARSH\SQL2012;initial catalog=Aria;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 
    <add name="AMSEntities" connectionString="metadata=res://*/Model.AMS.csdl|res://*/Model.AMS.ssdl|res://*/Model.AMS.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=BIC-SVR-AMS1;initial catalog=ToroRossoAMS;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 
    </connectionStrings> 
    <applicationSettings> 
    <ARIA.Properties.Settings> 
     <setting name="MedusaPath" serializeAs="String"> 
     <value>\\bic-svr-aria01\Medusa</value> 
     </setting> 
     <setting name="LogHeartbeat" serializeAs="String"> 
     <value>False</value> 
     </setting> 
     <setting name="UseRepository" serializeAs="String"> 
     <value>False</value> 
     </setting> 
    </ARIA.Properties.Settings> 
    </applicationSettings> 
</configuration> 

Сервис

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" /> 
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 
     <section name="MetricBroadcast.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </sectionGroup> 
    </configSections> 
<log4net> 
    <root> 
     <level value="DEBUG" /> 
     <appender-ref ref="LogFileAppender" /> 
    </root> 
    <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> 
     <param name="File" value="MetricBroadcast.Log" /> 
     <param name="AppendToFile" value="true" /> 
     <rollingStyle value="Size" /> 
     <maxSizeRollBackups value="100" /> 
     <maximumFileSize value="100MB" /> 
     <staticLogFileName value="true" /> 
     <layout type="log4net.Layout.PatternLayout"> 
     <param name="ConversionPattern" value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /> 
     </layout> 
    </appender> 
    </log4net> 
    <connectionStrings> 
    <add name="MetricBroadcast.Properties.Settings.TargetConnectionString" 
     connectionString="Data Source=BIC-SVR-TSTARIA01\SQL2012;Initial Catalog=Aria;Persist Security Info=True;User ID=XXXXXX;Password=XXXX" /> 
    </connectionStrings> 
    <system.serviceModel> 
    <bindings> 
     <netTcpBinding> 
     <binding name="BindingReliableMessaging" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"/> 
      <reliableSession enabled="true" inactivityTimeout="23:59:59"/> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="BroadcasterServiceBehavior" name="MetricBroadcast.BroadcasterService"> 
     <endpoint address="" binding="netTcpBinding" bindingConfiguration="BindingReliableMessaging" contract="MetricBroadcast.IBroadcasterService" /> 
     <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="net.tcp://BIC-SVR-TSTARIA01:8080/MetricBroadcast" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <!-- A behavior definition --> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="BroadcasterServiceBehavior"> 
      <serviceMetadata httpGetEnabled="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
    <applicationSettings> 
    <MetricBroadcast.Properties.Settings> 
     <setting name="LogXML" serializeAs="String"> 
     <value>True</value> 
     </setting> 
    </MetricBroadcast.Properties.Settings> 
    </applicationSettings> 
</configuration> 
+0

Не могли бы вы разместить файлы конфигурации сервера и клиента? –

+0

Я добавил файлы конфигурации для клиента и сервера по запросу –

ответ

0

OK, его время для немного красного лица - оказалось, что я редактировал неправильный файл конфигурации - он был настроен для отладки и выпуска среды d Я редактировал основной файл, который записывается при компиляции.

Doh.

Я буду в углу с заостренной шляпой.

Rob

Смежные вопросы