in-spite of configuring large timeout values, i am still getting "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 '10:10:10'."
My Client web.config looks like this:
<bindings>
<customBinding>
<binding name="HttpBinding" openTimeout="1:00:00" sendTimeout="1:00:00" receiveTimeout="01:00:00" closeTimeout="1:00:00">
<binaryMessageEncoding>
<readerQuotas maxDepth="4194304" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4194304" maxNameTableCharCount="4194304" />
</binaryMessageEncoding>
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
<binding name="CustomNetTcpBindingConfig" openTimeout="1:00:00" sendTimeout="1:00:00" receiveTimeout="1:00:00" closeTimeout="1:00:00" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4194304" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" >
<binaryMessageEncoding compressionFormat="GZip">
<readerQuotas maxDepth="4194304" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4194304" maxNameTableCharCount="4194304" />
</binaryMessageEncoding>
<windowsStreamSecurity protectionLevel="None" />
<tcpTransport />
</binding>
</customBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IDataUploader" closeTimeout="10:01:00" openTimeout="11:01:00" receiveTimeout="11:10:00" sendTimeout="11:01:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="10000000" maxBufferSize="100000000" maxConnections="10" maxReceivedMessageSize="100000000">
<readerQuotas maxDepth="4194304" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4194304" maxNameTableCharCount="4194304" />
<reliableSession ordered="true" inactivityTimeout="10:10:00" enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<endpoint address="net.tcp://corp.address.com/FileTransferService" binding="customBinding" bindingConfiguration="CustomNetTcpBindingConfig" contract="Intel.ATRMS.IDataUploader" name="NetTcpBinding_IDataUploader">
<identity>
<servicePrincipalName value="" />
<dns value="corp.address.com" />
</identity>
</endpoint>
<behaviors>
<endpointBehaviors>
<behavior name="ClientBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MTServiceBehavior">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
<serviceThrottling maxConcurrentCalls="75" maxConcurrentSessions="75" />
</behavior>
</serviceBehaviors>
</behaviors>
My Server side config looks like this :
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="StreamsBehaviour"
name="data.StreamedFileTransfer.StreamHandler">
<endpoint address="" binding="customBinding" bindingConfiguration="CustomNetTcpBindingConfig"
contract="data.StreamedFileTransfer.IDataUploader" name="NetTcpBinding_IDataUploader">
<identity>
<dns value="corp.address.com" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://corp.address.com/FileTransferService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="StreamsBehaviour">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding
openTimeout="01:00:00"
closeTimeout="01:00:00"
receiveTimeout="01:00:00"
sendTimeout="01:00:00"
transferMode="Streamed"
maxBufferPoolSize="524288"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
name="MainBinding">
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows"/>
</security>
</binding>
</netTcpBinding>
<customBinding>
<binding name="CustomNetTcpBindingConfig" closeTimeout="1:00:00" openTimeout="1:00:00" receiveTimeout="1:00:00" sendTimeout="1:00:00" maxBufferPoolSize="524288"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<windowsStreamSecurity protectionLevel="None" />
<binaryMessageEncoding compressionFormat="GZip">
<readerQuotas maxDepth="4194304" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4194304" maxNameTableCharCount="4194304" />
</binaryMessageEncoding>
<tcpTransport />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
Went through most of the solutions on stackoverflow. But still i am getting same error.
some forums sites which i referred
- https://social.msdn.microsoft.com/Forums/vstudio/en-US/ed0fd370-fa14-4c40-8068-4327786f1f49/the-socket-connection-was-aborted-this-could-be-caused-by-an-error-processing-your-message-or-a?forum=wcf
- https://www.codeproject.com/Questions/633699/Socket-Exception-WCF
Edit:
- It is failing for only large files like 100 MB. But i am able to upload 10 KB files.
- Set all the attributes values such as (MaxItemsInObjectGraph, MaxReceivedMessageSize, MaxBufferPoolSize, MaxBufferSize, MaxArrayLength) to maximum.
Please guide me.