c# - WCF Service - Message / Object size related -


i have wcf service (s1) client , wcf service(s2) server. s1 consume s2 on net.tcp. s2 has 1 operation, return complex object of it's contents string. average size of object between 7-8 mb.

recently had add more string contents actual object graph. cause s2 return following error

the socket connection aborted. caused error processing message or receive timeout being exceeded remote host, or underlying network resource issue. local socket timeout '00:05:00'. system.net.sockets.socketexception (0x80004005): existing connection forcibly closed remote host @ system.net.sockets.socket.receive(byte[] buffer, int32 offset, int32 size, socketflags socketflags) @ system.servicemodel.channels.socketconnection.readcore(byte[] buffer, int32 offset, int32 size, timespan timeout, boolean closing)

however, works expected when remove of string contents object graph.

after doing bit of homework,i managed land on conclusion that, has size of returned object. made me revise client , service configuration/quota's.

however, have no luck after modifying client , service size related attributes.

can guide me on this? please ask me more information if needed.

thanks in advance.

client (s1)

<nettcpbinding>         <binding name="nettcp" closetimeout="00:05:00"           opentimeout="00:05:00" receivetimeout="00:10:00" sendtimeout="00:05:00"           transactionflow="false" transfermode="buffered" transactionprotocol="oletransactions"           hostnamecomparisonmode="strongwildcard" listenbacklog="10" maxbufferpoolsize="2147483647"           maxbuffersize="2147483647" maxconnections="10" maxreceivedmessagesize="2147483647">           <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647"             maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="16384" />           <reliablesession ordered="true" inactivitytimeout="00:10:00"             enabled="false" />           <security mode="none">             <transport clientcredentialtype="windows" protectionlevel="encryptandsign" />             <message clientcredentialtype="windows" />           </security>         </binding>       </nettcpbinding>     <client>           <endpoint address="net.tcp://xxxxxxxx/xxxxxxservice"             binding="nettcpbinding" bindingconfiguration="nettcp" behaviorconfiguration="rbehavior"               contract="iservice" name="nettcp" />         </client>         <services/>          <behaviors>           <servicebehaviors>             <behavior name="nsbehavior">               <etwtracking profilename="endtoendmonitoringprofile"/>               <servicemetadata httpgetenabled="false"/>               <servicedebug includeexceptiondetailinfaults="true"/>             </behavior>             </servicebehaviors>         <endpointbehaviors>                                                    <behavior name="rbehavior">      **<datacontractserializer maxitemsinobjectgraph="2147483647" />**                 </behavior>             </endpointbehaviors>         </behaviors>          <servicehostingenvironment multiplesitebindingsenabled="true" />       </system.servicemodel>       <system.webserver>         <modules runallmanagedmodulesforallrequests="true"/>       </system.webserver> 

server (s2)

<system.servicemodel>     <bindings>       <nettcpbinding>         <binding name="nettcp" closetimeout="00:03:00"           opentimeout="00:03:00" receivetimeout="00:10:00" sendtimeout="00:03:00"           transactionflow="false" transfermode="buffered" transactionprotocol="oletransactions"           hostnamecomparisonmode="strongwildcard" listenbacklog="10" maxbufferpoolsize="20000000"           maxbuffersize="20000000" maxconnections="10" maxreceivedmessagesize="20000000">           <readerquotas maxdepth="32" maxstringcontentlength="20000000"             maxarraylength="20000000" maxbytesperread="4096" maxnametablecharcount="16384" />           <reliablesession ordered="true" inactivitytimeout="00:10:00"             enabled="false" />           <security mode="none">             <transport clientcredentialtype="windows" protectionlevel="encryptandsign" />             <message clientcredentialtype="windows" />           </security>         </binding>       </nettcpbinding>     </bindings>      <services>       <service name="engine.rules"                behaviorconfiguration="reservicebehavior">         <host>           <baseaddresses>             <add baseaddress="net.tcp://xxxxx:8005/service"/>           </baseaddresses>         </host>         <endpoint address=""                   binding="nettcpbinding" bindingconfiguration="nettcp"                   contract="ixxxx" />         <endpoint address="mex"                   binding="mextcpbinding"                   contract="imetadataexchange" />       </service>     </services>     <behaviors>       <servicebehaviors>         <behavior name="reservicebehavior">           <servicemetadata httpgetenabled="false"/>       **<datacontractserializer maxitemsinobjectgraph="2147483647"/>**           <servicedebug includeexceptiondetailinfaults="true"/>             <servicethrottling maxconcurrentsessions="1000"/>         </behavior>       </servicebehaviors>     </behaviors>   </system.servicemodel> 

update: per @erikfunkenbusch's sensible support, attaching service trace information.exception

<exceptionstring>system.servicemodel.communicationexception: socket connection aborted. caused error processing message or receive timeout being exceeded remote host, or underlying network resource issue. local socket timeout '00:05:00'. ---&gt; system.net.sockets.socketexception: existing connection forcibly closed remote host    @ system.net.sockets.socket.receive(byte[] buffer, int32 offset, int32 size, socketflags socketflags)    @ system.servicemodel.channels.socketconnection.readcore(byte[] buffer, int32 offset, int32 size, timespan timeout, boolean closing)    --- end of inner exception stack trace ---</exceptionstring> <innerexception> <exceptiontype>system.net.sockets.socketexception, system, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089</exceptiontype> <message>an existing connection forcibly closed remote host</message> <stacktrace> @ system.net.sockets.socket.receive(byte[] buffer, int32 offset, int32 size, socketflags socketflags) @ system.servicemodel.channels.socketconnection.readcore(byte[] buffer, int32 offset, int32 size, timespan timeout, boolean closing) </stacktrace> <exceptionstring>system.net.sockets.socketexception (0x80004005): existing connection forcibly closed remote host    @ system.net.sockets.socket.receive(byte[] buffer, int32 offset, int32 size, socketflags socketflags)    @ system.servicemodel.channels.socketconnection.readcore(byte[] buffer, int32 offset, int32 size, timespan timeout, boolean closing)</exceptionstring> <nativeerrorcode>2746</nativeerrorcode> </innerexception> </exception> 

have tried increasing send , receive timeout values? you're sending lot of data on wire (7-8mb) , 5 seconds may not enough time complete transaction. try setting them 30 seconds , working there.

e:

<binding name="nettcp" closetimeout="00:30:00"       opentimeout="00:30:00" receivetimeout="00:30:00" sendtimeout="00:30:00"> 

that i'm referring to, specifically.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -