c# - web calls never timing out -
i have number of applications using various web technologies such soap, wcf services, or simple xmlreader. seem suffer same problem of missing timeout , hanging infinitely if internet connection suffers problems @ wrong time.
i have set timeout in scenarios small, e.g. wcf
closetimeout="00:00:15" opentimeout="00:00:15" receivetimeout="00:00:15" sendtimeout="00:00:15"
or soap
_session.timeout = (int)timeout.totalmilliseconds;
these timeouts hit, appears there special case if internet drops out @ right time, call hang , never time out (using synchronous calls).
i considering starting timer every time make call, , using appropriate .abort()
function if timer expires cancel call. however, wondering if there simpler way fix issue , ensure timeout gets hit.
does know why occurs, , if clean/simple/good way ensure calls time out?
i can guess @ why occurs, without giving solution :(
i suspect it's getting caught on dns resolution. i've seen various situations "doesn't count" - e.g. ends happening on initiating thread of asynchronous call, or it's not been included in timeouts.
if you're able reproduce pulling out network cable, i'd suggest using wireshark confirm guess - @ least suggest further avenues investigation. maybe there's dns timeout somewhere in .net stack infinite can tweaked, example.
Comments
Post a Comment