c#


Underlying Connection Failed after some time


We have a WPF application which communicates through REST API hosted on Production Environment running SQL Server 2012.
WPF application works fine but after some few hours of CRUD operations it keeps throwing Under Lying Connection Close exception. Until I restart the SQL Services I am running SQL Express Edition 2012 also on development environment. But it works fine on development environment.
There are a few reasons this could occurr 1) Server or router has settings that are closing the TCP connection. Like a maximum open time. 2) More often this occurs due to the tables that TCP keeps for retrying packets. TCP breaks messages into 1500 byte datagrams (data portion of packet). TCP sends an ACK for each messages sent. When a packet doesn't get ACK it will get resent usually 3-5 times at around 5 seconds a retry. Packets also can be receive in random order. So the sending side of TCP must keep each packet in a table until an ACK is received. Then remove packet from table. The receiver must have table to reorder packets. Packets are removed from table when all previous packets are received. These tables can get very large and then the operating system will probably close application. Normally what causes this to happen is when the receiving end is running a lot of applications it doesn't ACK a message in 5 seconds. So the Sending end re-sends packets. The resend packets sends more data which adds more processing to the receiver slowing the receiver even more. The best way of checking for issue is to use a sniffer like wireshark or fiddler and see if you see duplicate packet numbers which indicates a retry. You should normally see each packet number twice (once when sent and once when ACK).

Related Links

Render javascript (or css) via c#
MonoTouch library project only works when directly referenced
How to prevent namespace pollution?
Web Service responds to caller while still processing thread
Why does linq-2-sql create extra unnecessary objects?
How to send a string array to a COM PORT?
How to open usercontrol in a click of a button C#
How to send key strokes (key presses) to a minimized (not focused) form?
In .net c# with Unity how to MapTo multiple?
Testing if a button has been clicked or not
unique identifier For each browser using asp.net
Color underline on C# colors in Visual Studio 2010
How to work with two databases having the same tables in C#?
Using a repository for a single method returning a single value?
String sorting performance degradation in VS2010 vs. VS2008
MVC3 Model binding in HTTP GET request?

Categories

HOME
ssms
qemu
latex
c++builder
datetimepicker
esxi
download
thermal-printer
jshell
richtextbox
symfony-3.2
normals
gcloud
mongodb-replica-set
popup
google-calendar-api3
project-reactor
rndis
quality-center
ithit-webdav-server
ckeditor4.x
grunt-contrib-uglify
continuous-fourier
tftp
resx
sqldependency
emr
cqlsh
jmsserializerbundle
webspeech-api
voyager
imageprocessor
machine-code
headphones
border-layout
multi-user
form-fields
queryover
var
stdin
ng-lightning
flume-ng
definition
pexpect
niagara-ax
beanshell
critical-section
printer-control-language
trusted-computing
spring-cloud-aws
timex
easy-thumbnails
android-music-player
mac-app-store
class-design
normalisation
falcon
nimbus
vitamio
kik
aws-kms
pyshark
code-translation
hana-sql-script
eaaccessory
chunks
esri-arc-engine
triplestore
object-oriented-database
mandelbrot
usersettings
symbian3
outlook-object-model
servicemanager
boost.build
dnsbl
algol
linear-interpolation
event-propagation
pex-and-moles
qvariant
cpack
marathontesting
dongle
silverlight-2.0
lts
rpxnow
jgrowl

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App