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# IndexOutOfRange Array Exception
Catching a pattern, but ignoring it within quotes
Reference not working in Visual Studio 2012
Export musical note data to midi
How can I retrieve records or views from entity?
Is there a way to display an audio wave as Windows Speech Synthesizer speaks?
Regex match for tags within tags and last matching tag
Is there a better way to leverage an implicit type conversion operator on an `object` than using raw reflection?
iis 8 fails loading owin.Oaut 3.1
Code in user control breaks design mode in Visual Studio 2015
Error 400 bad request while sending message with Telegram Bot
Database update on each button press
Stop detecting Input in Unity?
How to add a Service Reference to a service application
ComboBox DropDown Trigger isn't working after using ToggleButton
c# array of strings is not getting displayed

Categories

HOME
actionscript-3
netty
qemu
ldap
microcontroller
postsharp
magento-1.9.2.1
watson-iot
x509certificate
esxi
open-search-server
select2
kairosdb
jetbrains
cakephp-2.0
opendaylight
box2d
tag-cloud
civicrm
prepros
chartist.js
datanucleus
android-6.0-marshmallow
formtastic
osgi-bundle
overflow
foxpro
loopback
ng2-bootstrap
incapsula
minitest
motherboard
abide
nsdateformatter
mockserver
latency
ng-lightning
delphi-xe
text-extraction
amazon-fire-tv
npoco
perldoc
jcifs
cedar-bdd
gevent
3d-rendering
user-profile
radar-chart
calc
skbio
kramdown
skscene
random-sample
pagecontrol
web-standards
data-representation
stderr
avd
valdr-bean-validation
connection-timeout
conkeror
report-builder2.0
novell
conditional-comments
parsefloat
powershell-v1.0
worklight-appcenter
fscanf
ccmenuitem
amzi-prolog
episerver-7
django-tests
sendy
sqldatasource
google-oauth-java-client
aspnet-compiler
infomaker
ojb
mandelbrot
simplemembership
setcookie
libx264
shapado
nude.js
optimistic-concurrency
animationdrawable
facebook-winjs-sdk
datejs
mismatch
n2
miniport

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