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

C# OpenCV: Detecting a Stop Sign
Not understanding the purpose of memory barriers in C#
EntityValidationErrors Property??? Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
Webrequest looks identical but won't log in?
C# checkbox event in asp.net mvc view not inside form
MonoGame porting to linux
Add to usings doesn't appear as resolve option in Visual Studio 2015
Outlined font effect for text in WPF
How to draw tensor visualization on a 2D grid
NullReferenceException C# [duplicate]
c# How do I detect if a line (painted/drawn on a form) has been clicked on when using winforms?
Parse the css content in C#
Stripe.net - Try to charge on behalf
Running oracle script in c#
How to calculate Sum of Peak and Offpeak hours in List<TimeSpan>
MySQL preprocessor optimization

Categories

HOME
qlikview
ftp
itunesconnect
ns2
dronekit
ibm
boxplot
redhawksdr
xss
restheart
soap-client
ethereum
theory
digital
osrm
mongodb-replica-set
hdf5
element
repeater
hql
facebook-marketing-api
amazon-data-pipeline
versioning
conditional-formatting
scotty
android-wear-2.0
marionette
setup-project
sqldependency
epub
flickr
jsonapi-resources
lex
instances
jquery-inputmask
julia-jump
rbac
wicket-tester
susy
aspnetboilerplate
smooth-streaming
jks
anonymous-function
emacs24
openxava
google-cloud-shell
cancan
px4
hellosign
trusted-computing
tsc
acceleo
catalyst
sharing
stringbuilder
alarmmanager
firebase-job-dispatcher
mavlink
alfred
netlink
camellia
nd4j
clique
alchemy
jsondoc
wonderware
exchange-server-2007
properties-file
nmock
photogrammetry
tidesdk
valdr-bean-validation
strcpy
illegalargumentexception
nsnotificationcenter
tigase
parallel-port
rpt
visual-c#-express-2010
scjp
switchpreference
xps
email-headers
codio
vbaccelerator
imaplib
google-voice
scidb
raddatepicker
static-class
azure-pack
listpicker
usersettings
gwt2
pageload
biztalk-deployment
urlfetch
django-tinymce
hypertable
jquery-1.8
github-archive
dancer
erlide
animationdrawable
recess
hwnd
cinder
fxcopcmd
manuals
software-update

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