As you probably already know, you can open handles to q processes using hopen followed by the port number (or the IP address followed by the port number). So for instance, if there was another q process running on port 1234, you could open a handle to it by using h: hopen 1234. Handles in q are represented by integers, so hopen 1234 will just return an integer and h will just be an integer (say, for instance, 7). Normally when sending messages using a handle, you would do something like h “trades”, but since h is just an integer, doing 7 “trades” will give exactly the same thing.
Now, the integer 0 represents the handle to the process you are currently in, and allows you to send messages to yourself. For instance, you could do the following: q)x: 5 q)0 “x” 5
The advantage of this, is that you can use this with the \T command line argument to set a timeout for remotely executed commands. This means that if you want some parts of your script to timeout if they take too long but not others, then you can just send it via the 0 handle. For instance, in the following few lines I am infinitely adding one to zero. In the first case, it times out as I’ve set the \T command, but in the second case it runs indefinitely. q)\T 1 q)0 “{1b} (1+)/ 0” 'stop [2] {1b} ^ q)){1b} (1+)/ 0 — process runs indefinitely —