Solved

WCF error, “An existing connection was forcibly closed by the remote host.”

Posted on 2010-09-20
13
2,289 Views
Last Modified: 2012-05-10
I have a air of applications, both developed in house, that communicate using WCF tcp binding.  I am receiving the following errors, but I cannot determine why.  Can anyone suggest a reaosn why I might get this problem?

I have attached a zip file that contains a svclog. To open please rename the extension from log back to svclog. (Cannot upload svclog files, even in a zipped file).

Thanks

Server-App-tracelog.svclog.zip
0
Comment
Question by:townsma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33714725
this can happen if there is an exception in your piece of code. can you post the server side code ?
0
 
LVL 6

Author Comment

by:townsma
ID: 33714859
Which particular piece of code do you want to see?  The code is split amonst many classes and interfaces.
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33714894
when are you getting this error ? if you are trying to invoke some method when you encounter this error then please post that...
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 6

Author Comment

by:townsma
ID: 33714994
That is the problem, the error message is too generic, so I cannot pin down an individual method.  I am currently setting up two computers with VS2008 on the them so I can debug both apps at the same time to see where the first exception is thrown..  

Currently the only indication of an error is the WCF trace, and the fact the database is not updated.  There ar eno .Net exceptions being thrown that I can find, and nothing is being written to the Event Log.
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33715263
another possible error the data you  are sending/receving is going above the limits mentioned in the behaviour. Try setting it to max and see. See sample config below

<basicHttpBinding>
				<binding name="myBindingConfiguration" maxBufferSize="2147483647"
          maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
					<security mode="TransportCredentialOnly">
						<transport clientCredentialType="Ntlm" />
					</security>
					<readerQuotas
             maxArrayLength="2147483647"
             maxBytesPerRead="2147483647"
             maxDepth="2147483647"
             maxNameTableCharCount="2147483647"
             maxStringContentLength="2147483647" />
				</binding>
</basicHttpBinding>

Open in new window

0
 
LVL 6

Author Comment

by:townsma
ID: 33715343
We currently have the limits set to max, in the client and server, and have the security set to none.
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 250 total points
ID: 33715372
The in that case your service is throwing an unhandled exception.. Run your service under a debugger and break on exceptions...which would tell you where the exception is or add a service behaviour to send the exception to the client

[ServiceBehavior(
        IncludeExceptionDetailInFaults = true    

  )]
0
 
LVL 6

Author Comment

by:townsma
ID: 33715665
I added the behaviour two days ago, but made no difference to the reports I received.

I have also been running the server and client in a debug session, but as I mentioned earleir, no exceptions are being thrown that I can find.

0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33731908
I'm being a bit silly here and you may know this already - The fault details will be in the inner exceptions and may not be necessarily in the first level.. Have you verified this ??
0
 
LVL 6

Author Comment

by:townsma
ID: 33731947
The error message in the title is from the inner exception.

Thanks for the thought though.
0
 
LVL 9

Assisted Solution

by:Orcbighter
Orcbighter earned 250 total points
ID: 33777659
The 'connection was forcibly closed' error message is telling you the server-side shut down the connection.
On viewing your log file, the exception states that the connection was closed because of either a problem with the message you sent, a timeout occurred on the remote host.
If you examine the log you will see that E2ETraceEvent ID=131075 logs the error. It occurred just after the ResortManager executed a 'listen'. The exception was thrown because...
"The TransportManager failed to listen on the supplied URI using  the NetTcpPortSharing service: failed to start the service because it is  disabled."

This is where you need to look. Check this service is running.

0
 
LVL 6

Author Comment

by:townsma
ID: 33795560
Hi Everyone,

Many thanks for all you assistance.  After much work, I have finally pinned down the failure.  In reality it had nothing to do with WCF, which makes it very strange that WCF was the only part of the program throwing any errors.  

The problem turned out the be OR/M database update command that was failing.  The update was being called remotely, so WCF was throwing the error.  But it is strange that that the SQL and ORM etc. did not throw any errors.

So to every, again thanks for your help.

I will share the points between all the contributors, as all of you advice ultimately led me in the right direction.
0
 
LVL 6

Author Closing Comment

by:townsma
ID: 33795576
Hi Everyone,

Many thanks for all you assistance.  After much work, I have finally pinned down the failure.  In reality it had nothing to do with WCF, which makes it very strange that WCF was the only part of the program throwing any errors.  

The problem turned out the be OR/M database update command that was failing.  The update was being called remotely, so WCF was throwing the error.  But it is strange that that the SQL and ORM etc. did not throw any errors.

So to every, again thanks for your help.

I will share the points between all the contributors, as all of you advice ultimately led me in the right direction.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question