hopen with timeout

hopen(`::5000;10000) works fine when there is a q session with port 5000.
But it gives an error if there is no q session on port 5000.

I was hoping it will wait 10 seconds before trying again. But it fails right away.

Has anyone used hopen with a timeout?

This hopen timeout is more for the case when the remote process is not responsive during connection (busy with another query, in debug mode, etc.). When there is no process listening on the target port, hopen fails straightaway. If you do want a hopen-with-retry kind of semantics, it’d better to just write your little wrapper around hopen with a while loop or something similar.

This might help: 

{h::@[hopen;(:host:port:user:pass);0];while[0=h;system"sleep 5";h::@[hopen;(:host:port:user:pass);0]]}


Regards

Alex

On Tuesday, 3 July 2018 00:57:53 UTC+1, sudhakar wrote:

hopen(`::5000;10000) works fine when there is a q session with port 5000.
But it gives an error if there is no q session on port 5000.

I was hoping it will wait 10 seconds before trying again. But it fails right away.

Has anyone used hopen with a timeout?