Finding clients connected .z.W - Kdb+ / qStudio

Home Forums Kdb+ / qStudio Finding clients connected .z.W


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #138

    Oskar Morgenstern

    I know .z.W lists the handles for connected clients, how can I find their details?

    When I connect using qstudio I see one handle 392 which is obviously just me. If I was at the console how would I get details on that 392 handle? Host, port, username? For every connected client?



    There are a few special variables when communicating between kdb processes using IPC:

    .z.w – When called inside a synchronous call, gives the return handle back to the caller.
    .z.a – Returns the current IP address, if called inside a remote call this will be the remote IP address.
    .z.u – Return the current users name, if called inside a remote call this is the name supplied when the connection was created.
    You could also query each of the handles querying the usual variables, system “p” to get the port etc. Though I would be careful doing that as if the remote process is not a kdb process it is possible that it will crash. e.g.

    q){("." sv string "i"$0x0 vs .z.a;.z.u)} each .z.W
    408| "" `ryan
    412| "" `admin

    Alternatively you could log the details of each user as they connect or disconnect by overriding the event handlers. A full example can be found at:

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.