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

Error saving and getting an ObservableCollection in IsolatedStorage
Datagrid Multiple Column Sorting
Using Kerberos Tokens in C#
ListView is creating new controls instead of refreshing
Read Excel file
Setting readonly fields (Is this bug?)
asp.net mvc areas and main site w/ same controller names
How to Access a Web Service on a Host with no External IP Address?
Performing spatial searches in nHibernate
Creating file with .txt extension (C#)
C#.NET coming from PHP
N-tier Repository POCOs - Aggregates?
Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE) Workarounds
Are EF objects thread-safe?
Using ASP.NET Membership provider (No login logic?)
Tab index not work after set the Checked property of RadioButton

Categories

HOME
oauth-2.0
logging
youtube-api
sql-server-2014
sip
customization
abc
hex
magento-1.9.2.1
assign
app-store
query-string
localhost
servicenow
collision-detection
google-api-oauth
subprocess
browsermob
cakephp-2.0
jinja2
sha1
facebook-marketing-api
react-jsx
mattermost
rvm
functional-dependencies
scrapy-spider
datastax-enterprise
core-animation
pypy
javapns
ds-5
ipython-parallel
intermec
log4net-configuration
spring-oauth2
imageprocessor
openvms
perf
dotnetnuke-module
redbean
irr
head
cakephp-3.2
scrapinghub
encoder
spring-data-commons
easyquery
noise
bioperl
typewriter
androiddesignsupport
cc
printer-control-language
bipartite
scanf
sharing
blackberry-webworks
git-cherry-pick
change-password
boost-propertytree
window.location
code-translation
dcast
ooad
skscene
newlib
event-tracking
personality-insights
roslyn-code-analysis
android-filterable
stderr
tidesdk
veeam
firebase-tools
google-experiments
alpha-beta-pruning
method-overloading
report-builder2.0
grunt-contrib-connect
register-allocation
growl
nsnotificationcenter
parsefloat
cocos2d-x-2.x
dateadd
farpoint-spread
internet-radio
codio
vbaccelerator
infomaker
static-class
jython-2.5
uikit-dynamics
bho
string-length
qt5.1
libx264
openafs
animationdrawable
isgl3d
flexbuilder
peoplepicker
jqtransform
mysql-pconnect
web-widget
zend-acl
jgrowl
tracd





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