none
An unhandled exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll

    Dotaz

  •  Hi All,
            I am using client and server model My server raises an event to clinet and sends List<string> Item.List Item contains 3000 object.When I raise an event I am getting following error

    Additional information: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.
    please refer my config files.

    My code is working for smaller number of list objects say 30.

    ------------------------------ server app.config---------------------------------------
    <?xml version = "1.0" encoding = "utf-8" ?>
    <configuration>
      <!--<system.serviceModel>
        <services>
     
          <service name = "MyPubslisher">
     
            <endpoint
               address  = "net.tcp://localhost:8001/MyService"
               binding  = "netTcpBinding"
               contract = "IMyContract"
              
                />
     
     
     
          </service>-->
     
      <system.serviceModel>
     
        <services>
     
          <service name="MyPubslisher">
     
            <endpoint address="net.tcp://localhost:8001/MyService"
     
            binding="netTcpBinding"    bindingName="bindCmdHandler"        
     
            contract="IMyContract"/>
     
          </service>
     
        </services>
     
     
     
        <bindings>
     
          <netTcpBinding>
     
            <binding name="bindCmdHandler"
     
            closeTimeout="00:30:00"
     
            openTimeout="00:30:00"
     
            receiveTimeout="00:30:00"
     
            sendTimeout="00:30:00"
     
            transactionFlow="false"
     
            transferMode="Buffered"
     
            transactionProtocol="OleTransactions"
     
            hostNameComparisonMode="StrongWildcard"
     
            listenBacklog="100"
     
            maxBufferPoolSize="524288"
     
            maxBufferSize="524288"
     
            maxConnections="100"
     
            maxReceivedMessageSize="524288">
     
              <readerQuotas maxDepth="38882"
     
              maxStringContentLength="524288"
     
              maxArrayLength="524288"
     
              maxBytesPerRead="524288"
     
              maxNameTableCharCount="524288" />
     
              <security mode="None">
     
              </security>
     
            </binding>
     
     
          </netTcpBinding>
     
        </bindings>
     
      </system.serviceModel>
     
     
     
      <!--</services>
      </system.serviceModel>-->
    </configuration>
     
    -------------------------------------------------------------------------------------------
    ----------------------------------------  client app.config   ---------------------------------
    <?xml version = "1.0" encoding = "utf-8"?>
    <configuration>
      <system.serviceModel>
        <client>
          <endpoint
             address  = "net.tcp://localhost:8001/MyService"
             binding  = "netTcpBinding"
             contract = "IMyContract" 
           />
         
        </client>
        <bindings>
     
          <netTcpBinding>
     
            <binding name="bindCmdHandler"
     
            closeTimeout="00:30:00"
     
            openTimeout="00:30:00"
     
            receiveTimeout="00:30:00"
     
            sendTimeout="00:30:00"
     
            transactionFlow="false"
     
            transferMode="Buffered"
     
            transactionProtocol="OleTransactions"
     
            hostNameComparisonMode="StrongWildcard"
     
            listenBacklog="100"
     
            maxBufferPoolSize="524288"
     
            maxBufferSize="524288"
     
            maxConnections="100"
     
            maxReceivedMessageSize="524288">
     
              <readerQuotas maxDepth="32"
     
              maxStringContentLength="524288"
     
              maxArrayLength="524288"
     
              maxBytesPerRead="524288"
     
              maxNameTableCharCount="524288" />
     
              <security mode="None">
     
              </security>
     
            </binding>
     
     
          </netTcpBinding>
     
        </bindings>
      </system.serviceModel>
    </configuration>
     
    -------------------------------------------------------------------------------------------
     
    server side program.cs
    ----------------------------------------
     static void Main()
            {
                ServiceHost host = new ServiceHost(typeof(MyPubslisher));// new Uri("http://localhost:8002/"));
                host.CloseTimeout = TimeSpan.FromMinutes(10);
                host.OpenTimeout = TimeSpan.FromMinutes(20);
     
                host.Open();
                Application.Run(new MyPublisherForm());
                host.Close();
            }
     
    -----------------------------------------------------------


    Suyog
    29. ledna 2009 6:22

Všechny reakce

  • Your client looks like

    <client>
          <endpoint
             address  = "net.tcp://localhost:8001/MyService"
             binding  = "netTcpBinding"
             contract = "IMyContract" 
           />     
    </client>

    Your forgot to add bindingConfiguration, so I should look like:

    <client>
          <endpoint
             address  = "net.tcp://localhost:8001/MyService"
             binding  = "netTcpBinding"
             contract = "IMyContract"  
             bindingConfiguration = "bindCmdHandler"
           />     
    </client>

    If it still gives you an CommunicationException, try increasing the limits of 

    maxBufferPoolSize
    maxBufferSize
    maxReceivedMessageSize
    maxArrayLength
    maxBytesPerRead

    29. ledna 2009 10:48
  • Hi Danny,

                 thanks for your reply.I have done following modification in app.config file.but still getting error.

    <?xml version = "1.0" encoding = "utf-8"?>

    <configuration>

    <system.serviceModel>

    <client>

    <endpoint

    address = "net.tcp://localhost:8001/MyService"

    binding = "netTcpBinding"

    contract = "IMyContract"

    bindingConfiguration = "bindCmdHandler"

    />

    </client>

     

    <behaviors >

    <endpointBehaviors >

    <behavior name="abc">

    <dataContractSerializer maxItemsInObjectGraph="2147483647"/>

    <callbackTimeouts transactionTimeout="10"/>

    </behavior>

    </endpointBehaviors>

    </behaviors>

    <bindings>

    <netTcpBinding>

    <binding name="bindCmdHandler"

    closeTimeout="00:30:00"

    openTimeout="00:30:00"

    receiveTimeout="00:30:00"

    sendTimeout="00:30:00"

    transactionFlow="false"

    transferMode="Streamed"

    transactionProtocol="OleTransactions"

    hostNameComparisonMode="StrongWildcard"

    listenBacklog="100"

    maxBufferPoolSize="2147483647"

    maxBufferSize="2147483647"

    maxConnections="100"

    maxReceivedMessageSize="2147483647">

    <readerQuotas maxDepth="1000"

    maxStringContentLength="2147483647"

    maxArrayLength="2147483647"

    maxBytesPerRead="2147483647"

    maxNameTableCharCount="524288" />

    <security mode="None">

    </security>

    </binding>

    </netTcpBinding>

    </bindings>

    </system.serviceModel>

    </configuration>


    Suyog
    29. ledna 2009 11:17
  • Try adding the next:

     

    <behaviors>
     
    <endpointBehaviors>
       <
    behavior name="MaxBehavior">
        <
    dataContractSerializer maxItemsInObjectGraph="2147483647"/>
       </
    behavior>
      </
    endpointBehaviors>
     </
    behaviors>
    <
    bindings>

    <endpoint
     
    address = "net.tcp://localhost:8001/MyService"
     
    binding = "netTcpBinding"
     
    contract = "IMyContract"
     
    bindingConfiguration = "bindCmdHandler"
      behaviorConfiguration="MaxBehavior"
    />

    29. ledna 2009 13:11
  • I think you need to increase the default timeout. Please go through the link.

    http://blogs.msdn.com/b/hongmeig/archive/2010/03/06/timeouts-in-wcf-and-their-default-values.aspx


    Manish Maheshwari Blog : http://manish2278.blogspot.in/

    26. dubna 2012 18:06