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

Close all child WPF windows and terminate awaiting code
Get element text from this span using Selenium WebDriver and C#
Modifying schema name in Entity Framework
Returns made by async Dispatcher Invoke not considered as return by method
Insert character before specific character c#
Irregular writting to XML with XDocument
not downloading file using webclient from server
Update toggle button's appearance (with style set in xaml) in code not working
Count number of records for a certain condition with linq
MVC 5 c# reporting errors back to the database
C# WPF Popup placement = center and on top of element
Crystal Report is not loading without error message
InstallShield and DllImport management
PARSE + Unity3d freezing from a query
C# console program wait forever for event
How to navigate between pages in windows phone 8.1RT

Categories

HOME
logging
ssms
mobile
gaussian
spotfire
markdown
osx-yosemite
genexus
annyang
box-api
olap
kairosdb
email-attachments
http-status-codes
element
bookmarklet
amazon-data-pipeline
simd
reportlab
orange
polybase
klipfolio
fastboot
uipath
ithit-webdav-server
ppp
aspxgridview
aws-certificate-manager
my.cnf
knapsack-problem
workflow-foundation
angular2-changedetection
scripting-language
ios9
schedule
ibm-bpm
matlab-compiler
ansible-inventory
cache-control
javafxports
linkurious
definition
libzip
f#-fake
npoco
flask-socketio
multivalue
ear
try-catch-finally
totalview
jtextarea
trusted-computing
robotc
vertex-shader
alarmmanager
timefield
distcc
access-violation
bbedit
std
maven-antrun-plugin
database-project
joomla3.3
transparentproxy
crystal-reports-7
method-overloading
uiblureffect
diffmerge
parsefloat
selenium-grid2
sqldatasource
html5-filesystem
data-layers
mahara
thucydides
code-complete
caroufredsel
qgraphicsscene
brew
configurationsection
freeimage
invalidoperationexception
mail-gem
openafs
states
flatten
django-1.4
nsundomanager
rjs
http-response-codes
virtual-destructor
nscharacterset
xslt-grouping
for-xml
web-search
ihtmldocument2
content-delivery-network

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App