How to prevent rare cases where RO HTTPS call hangs

On rare occasions we have a RO client (that uses a HTTPS connection) hangs in a call.

It gets stuck in Receive functions. See screenshot.

Is there a way to prevent this (apart from killing the thread and respawning it)?

What is your suggested approach?

Hi
The thread is stuck in the TLS handshake, not waiting for a reply…

As a workaround, add in a connection factory that sets the timeout before connecting.
The broken connection still can’t complete the call, but instead of hanging forever you get an exception after ConnectTimeout seconds catch it, drop the connection and retry.

public class TimeoutAwareSslFactory : HttpsConnectionFactory
{
    public TimeoutAwareSslFactory(HttpProxySettings proxy) : base(proxy) { }
    public int ConnectTimeout { get; set; } = 15;

    public override Connection CreateClientConnection(Binding binding)
    {
        var inner = new Connection(binding);
        inner.Timeout = this.ConnectTimeout;
        inner.TimeoutEnabled = true;
        if (!this.Enabled) return inner;

        var ssl = base.CreateClientConnection(inner);
        ssl.Timeout = this.ConnectTimeout;
        ssl.TimeoutEnabled = true;
        return ssl;
    }
}

Then set it on your channel right after you create it:

var factory = new TimeoutAwareSslFactory(channel.ProxySettings);
factory.CopyProperties(channel.SslOptions);
channel.HttpClient.SslOptions = factory;

We will fix this soon.

Logged as bugs://D19710.

bugs://D19710 was closed as fixed.

Fix will be in the next release

Is there a way of finding out as of which release this fix is in?

The link does not give me much info

We don’t have a specific date but we can upload current internal build with this fix so you can test it

I cannot trigger the issue, I just notice it occurs very infrequently.

If I read your comments correctly: I do not need to change/add any code myself? Just update to the latest SDK?

Yes, no code changes needed just update the SDK.

The timeout was always on by default (60 sec), it simply wasn’t applied during
connect and the TLS handshake.
Now it is, so the call throws instead of hanging.

Hello Artem,

I finally got around testing the personal download.

Are there new requirements for this SDK?

After upgrading the RO SDK it complains .NET 4.8 is needed, my code is still on 4.7.2

What will be the supported .NET (FW) versions?

FYI: We are using WCF, so we are stuck to .NET FW for now

Regards,

Frederic

Hi Frederic, .NET FW 4.7.2 stays supported exactly as before - we are correcting this now and will send you a new build shortly.

For testing right now, remove the RemObjects references from your project and add them again via Browse from these folders

  C:\\Program Files (x86)\\RemObjects Software\\RemObjects SDK for .NET\\Bin

  C:\\Program Files (x86)\\RemObjects Software\\Data Abstract for .NET\\Bin

Let me know if anything is still missing after that.

After removing and adding dlls in about 20 csproj files the code compiles and appears to run

Thanks!