hopen 5001 => 'hop. OS reports:

https://learninghub.kx.com/forums/topic/hopen-5001-hop-os-reports

Any clue about:

q)hopen 5001
'hop. OS reports: No connection could be made because the target machine actively refused it.
[0] hopen 5001
^

 

 

It doesn’t necessarily mean that the port is not available, but that there is currently no process listening on it.

If you are expecting a server to be running on that port, you might want to check what’s up with it - it might be crashing or hanging in an error trap, not reaching the point where it opens the port.

If you are just experimenting, you first need to start a second q process with the command line parameters -p 5001 which will make it listen on that port.

https://code.kx.com/q/basics/errors/#:~:text=formed%20select%20query-,hop,-Request%20to%20hopen

hop

Request to hopen a handle fails; includes message from OS

Your code is trying to open a handle to a process listening on port 5001 but one is not available.

 

 

Thank you for reply.

Does that mean the port is not available to be listened to?

How can I find out which ports can be chosen in this case?

Right, you’re right

Before using the hopen command, it is necessary to open the port listening with the p command:

p 5001 /system[“p 5001”] /q.exe -p 5001

hopen 5001

Now work

Thank you to all for answer