Reputation: 37993
I've got a NetTcp WCF service running on my server, and a client that's calling one of the methods of that service asynchronously.
When the server returns small amounts of data, everything is hunky dory. But when there's a lot of data to return, the client summarily crashes, without even so much as an exception to catch.
From what I can see, the crash happens almost immediately after the server returns the data.
Any ideas how to debug this? Is there some setting on the service that I should be tweaking to allow me to return large volumes of data in this call?
Upvotes: 1
Views: 417
Reputation: 1062512
My approach here is:
That should reduce the bandwidth in the different ways in parallel, and fix the issue.
Upvotes: 1
Reputation: 9519
Increasing the max size is not the best solution, if your service is hosted in IIS at some point it will crash. If you are using NetTCP bindig the best way of doing this is by exposing a Stream over TCP, look here.
Upvotes: 0
Reputation: 121
Try increasing the maxReceivedMessageSize="SomeMaxSize"
<binding name="BasicHttp" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard"
maxBufferSize="1000000" maxBufferPoolSize="524288" maxReceivedMessageSize="1000000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
You can also enable tracing for your service by adding below section to your web.config.
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\log\Traces.svclog" />
</listeners>
</source>
</sources>
Upvotes: 1