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

Composite iteration failure (.net)
VS2010 extension for formatting C# code
Getting Text from SysListView32 in 64bit
Stay Away from target
ValueInjecter and DataTable
VS2010 - PresentationFramework assembly. Why?
Queries about validating xml with XmlReader
JqGrid sorting on href tag and not content
Set minimum window size in C# .NET
Namespace mixed up by Compilator
using Reflections to access an Enum and use “Enum.TryParse” to compare values
How would I do this MySQL query in C#?
Binding a column within a generic List to GridView
suggested architecture\pattern to windows service which monitors and notify by mail for changes?
How do I store multiple results from a stored procedure into a dataset?
How to implement VaryByCustom caching?

Categories

HOME
oauth-2.0
asp.net
spring-boot
mobile
ns2
domain-driven-design
qemu
snappy
nagios
cryengine
where
lithium
ebay
grid
confluence-rest-api
comments
sequence
qt4
subprocess
infopath
brightway
owncloud
internet-explorer-7
vivado-hls
openoffice-basic
android-wifi
javaagents
email-client
chartist.js
pydub
gulp-jshint
dynamic-memory-allocation
emr
paper-trail-gem
intermec
mplab
visual-prolog
mootools
cocoa-scripting
client-server
stdin
sknode
google-cloud-powershell
firefox-developer-edition
encoder
activeandroid
xmldom
geminabox
g77
ear
audio-fingerprinting
sharpdevelop
boost-regex
was
qt3d
toggleclass
joystick
queuing
sbt-proguard
python-rq
sqlxml
android-progressbar
alchemy
bluetooth-lowenergy-4.2
google-app-engine-php
autoscaling
android-networking
glog
opennebula
maven-archetype
chrome-mobile
touch-typing
indices
mind-manager
react-os
rails-migrations
sigma-grid-control
facebook-likebox
thucydides
caroufredsel
oc4j
maven-webstart-plugin
stringstream
google-checkout
string-length
mmo
tasklist
gssapi
reflexil
helicontech
copyfile
zend-validate
auto-compile
cryptolicensing
virtual-destructor
large-data-volumes
mysql-pconnect
atmega16
authkit
file-icons
unauthorized
jettison
ironpython-studio

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile