EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElHTTPSClient: Multiple random Connection lost (error code is 100353)

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#37460
Posted: 08/15/2016 10:05:49
by Oleg Toyter (Standard support level)
Joined: 03/01/2016
Posts: 18

Hi,
We're using TElHTTPSClient to submit data to some web service. It is always the same URL. The web service we contact is a well known OPS service that usually has a very reliable service record so we're assuming that the communication errors we experience do not come from it.

We have random cases of multiple communication errors being reported.

Most of the errors are 'Connection lost (error code is 100353)' which can happen both immediately or after as much as 20 seconds of waiting.

Sometimes we get 'Connection timeout (error code is 96270)' after 30+ seconds of waiting. We have connection timeout set for 30 sec so its understandable although should not happen with this web service.

Sometimes we get 'The requested name is valid, but no data of the requested type was found'. This error happen usually after about 15 seconds.

Can you give us some points on what could go wrong?
Thanks.
Oleg.
#37461
Posted: 08/15/2016 10:25:52
by Eugene Mayevski (EldoS Corp.)

The last error clearly indicates the problem with the network or the network interface. It can't happen under normal conditions.

And all the errors that you list come from the Winsock layer, which means that they are beyond our control.

The possible reasons are (a) external (routers, firewalls, both hardware and software), (b) network connection itself (faulty or overheated network card, for example), and © less likely, some firewall or similar software installed on the computer itself.


Sincerely yours
Eugene Mayevski
#37465
Posted: 08/16/2016 05:34:26
by Oleg Toyter (Standard support level)
Joined: 03/01/2016
Posts: 18

Understandable.

Can you recommend some way to narrow down the root cause for those errors?
#37466
Posted: 08/16/2016 05:48:22
by Oleg Toyter (Standard support level)
Joined: 03/01/2016
Posts: 18

One more thing to point out.

This is a multi-threaded application that serves many users and there are multiple simultaneous HTTPS requests being made from different threads.
Each thread creates each own object of TElHTTPSClient class every time before making an HTTPS request.
Threads are reused serving multiple requests.
There is no explicit destruction of that object after a request, it simply goes out of function scope and is destroyed by GC at some later time.
Can it be that there are some resources shared by multiple instances of TElHTTPSClient that might cause such problems in multi-threaded configuration?
Should we explicitly destroy the instance we create?

Thanks.
#37467
Posted: 08/16/2016 06:59:46
by Eugene Mayevski (EldoS Corp.)

Quote
Oleg Toyter wrote:
Can you recommend some way to narrow down the root cause for those errors?


Some network diagnostics tool probably will show you if anything is wrong. But first please see my comment below.

Quote
Oleg Toyter wrote:
There is no explicit destruction of that object after a request, it simply goes out of function scope and is destroyed by GC at some later time. Can it be that there are some resources shared by multiple instances of TElHTTPSClient that might cause such problems in multi-threaded configuration? Should we explicitly destroy the instance we create?


Well, if the connections are keep-alive (and in most cases they are) and you don't close connection, then the socket handles are grabbed and not released, and yes, you can run out of winsock resources.

So it makes sense to explicitly call TElHTTPSClient.Dispose() method after you've finished using the instance. You can also reuse the instance, but be careful with thread synchronization.

In general GC is not very efficient in multithreaded and other loaded applications and we recommend disposing of all SecureBlackbox objects explicitly as if there were no GC at all.


Sincerely yours
Eugene Mayevski
#37470
Posted: 08/16/2016 10:29:29
by Oleg Toyter (Standard support level)
Joined: 03/01/2016
Posts: 18

Thanks.

I see there is TElHTTPSClient.Destroy() method. What is it and how does it differ from TElHTTPSClient.Dispose()? Which one should i use?
#37472
Posted: 08/16/2016 10:44:34
by Eugene Mayevski (EldoS Corp.)

Please use Dispose. Destroy is an internal method, it's actually a destructor (but you never call them yourself in .NET).


Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 657 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!