How to set SOCKET:CONNECT() timeout value

Posted by Lieven De Foor on 12-Jun-2014 09:54

Is there any way to specify the timeout for the SOCKET:CONNECT method?

Currently this seems to be around 2.5 seconds, which is way too long for my needs.

I've tried to work around this by using a STOP-AFTER, but that seems to get ignored...

Any ideas?

Posted by Marian Edu on 13-Jun-2014 00:48

can be done from a lower level, think had something like 'test service' in this little socket project have had a long time ago sourceforge.net/.../pro_sock

Posted by Arun Kumar Mohapatra on 13-Jun-2014 01:10

I think there a way to set timeout value in SOCKET:CONNECT() method, using "-clientConnectTimeout" parameter, it takes value in milli seconds. Basically this sets socket level timeout value in client side socket.

By default connect is blocking in nature, setting client connection timeout value makes the connection request non-blocking, and returns will error if connect not successful with in the given time interval.

Thanks,

Arun

Posted by Lieven De Foor on 13-Jun-2014 02:08

Thanks to both, I just got a reply from tech support mentioning the -clientConnectTimeout parameter too:

[quote]

There is an undocumented parameter for the CONNECT method which is "-clientConnectTimeout <n>". It needs to be added as part of the connection string. <n> is the number of milliseconds to wait before timing out the connection attempt.

This parameter was introduced for SSL connections in OpenEdge 10.2B07 or OpenEdge 11.2.0 or later. Support for non-SSL connections was added in OpenEdge 11.3. Please note that since OpenEdge 11, two connection attempts are made before the connection attempt is aborted. So please keep this in mind when calculating your timeout.

[/quote]

All Replies

Posted by Lieven De Foor on 12-Jun-2014 10:21

Even in other languages this appears to be tricky.

One way is to use another thread (no option in ABL), the other is to ping and if that succeeds try to connect (although ping just checks the availability of the host, not the port...)

bytes.com/.../476331-connect-socket-timeout

Posted by Marian Edu on 13-Jun-2014 00:48

can be done from a lower level, think had something like 'test service' in this little socket project have had a long time ago sourceforge.net/.../pro_sock

Posted by Arun Kumar Mohapatra on 13-Jun-2014 01:10

I think there a way to set timeout value in SOCKET:CONNECT() method, using "-clientConnectTimeout" parameter, it takes value in milli seconds. Basically this sets socket level timeout value in client side socket.

By default connect is blocking in nature, setting client connection timeout value makes the connection request non-blocking, and returns will error if connect not successful with in the given time interval.

Thanks,

Arun

Posted by Lieven De Foor on 13-Jun-2014 02:08

Thanks to both, I just got a reply from tech support mentioning the -clientConnectTimeout parameter too:

[quote]

There is an undocumented parameter for the CONNECT method which is "-clientConnectTimeout <n>". It needs to be added as part of the connection string. <n> is the number of milliseconds to wait before timing out the connection attempt.

This parameter was introduced for SSL connections in OpenEdge 10.2B07 or OpenEdge 11.2.0 or later. Support for non-SSL connections was added in OpenEdge 11.3. Please note that since OpenEdge 11, two connection attempts are made before the connection attempt is aborted. So please keep this in mind when calculating your timeout.

[/quote]

Posted by Marian Edu on 13-Jun-2014 02:15

nice explanation, would it be too hard to have it documented? even if it
was in some release notes not everyone is actually reading those :)



[collapse]On 06/13/2014 10:09 AM, Lieven De Foor wrote:
>[collapse] From: Lieven De Foor
> Post: RE: How to set SOCKET:CONNECT() timeout value
> Posted in: OpenEdge Development
> Link: http://community.progress.com/technicalusers/f/19/p/10777/40231.aspx#40231
>
> Thanks to both, I just got a reply from tech support mentioning the -clientConnectTimeout parameter too:
>
> There is an undocumented parameter for the CONNECT method which is "-clientConnectTimeout ". It needs to be added as part of the connection string. is the number of milliseconds to wait before timing out the connection attempt.
> This parameter was introduced for SSL connections in OpenEdge 10.2B07 or OpenEdge 11.2.0 or later. Support for non-SSL connections was added in OpenEdge 11.3. Please note that since OpenEdge 11, two connection attempts are made before the connection attempt is aborted. So please keep this in mind when calculating your timeout.
>
>
> --
> You were sent this email because you opted to receive email notifications when someone created a new thread.
>
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at http://community.progress.com/technicalusers/f/19/p/10777/40231.aspx#40231.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
>
>


--
m.edu
keep it simple
http://www.ganimede.ro
http://ro.linkedin.com/in/marianedu
medu@ganimede.ro
mobile: +40 740 036 212
skype: marian.edu[/collapse][/collapse][/collapse]

Posted by jmls on 13-Jun-2014 02:19

That's great information, thanks ☺
Now, let's all go and upgrade to 11.3 and start using it. whoHoo!

[collapse]
On 13 Jun 2014 08:15, "Marian Edu" <bounce-medu@community.progress.com> wrote:
Reply by Marian Edu
nice explanation, would it be too hard to have it documented? even if it
was in some release notes not everyone is actually reading those :)



[collapse]On 06/13/2014 10:09 AM, Lieven De Foor wrote:
>[collapse] From: Lieven De Foor
> Post: RE: How to set SOCKET:CONNECT() timeout value
> Posted in: OpenEdge Development
> Link: http://community.progress.com/technicalusers/f/19/p/10777/40231.aspx#40231
>
> Thanks to both, I just got a reply from tech support mentioning the -clientConnectTimeout parameter too:
>
> There is an undocumented parameter for the CONNECT method which is "-clientConnectTimeout ". It needs to be added as part of the connection string. is the number of milliseconds to wait before timing out the connection attempt.
> This parameter was introduced for SSL connections in OpenEdge 10.2B07 or OpenEdge 11.2.0 or later. Support for non-SSL connections was added in OpenEdge 11.3. Please note that since OpenEdge 11, two connection attempts are made before the connection attempt is aborted. So please keep this in mind when calculating your timeout.
>
>
> --
> You were sent this email because you opted to receive email notifications when someone created a new thread.
>
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at http://community.progress.com/technicalusers/f/19/p/10777/40231.aspx#40231.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
>
>


--
m.edu
keep it simple
http://www.ganimede.ro
http://ro.linkedin.com/in/marianedu
medu@ganimede.ro
mobile: +40 740 036 212
skype: marian.edu
Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse][/collapse][/collapse]

Posted by Lieven De Foor on 13-Jun-2014 02:19

The support engineer added:

[quote]

Please let us know if this works for you. I will then report this to our documentation team, because obviously it should be present in our documentation.

[/quote]

So I assume this should go in the docs for a next release...

This thread is closed