Chris
Chris

Reputation: 31

How to know the handle of the client that disconnects form a q service triggering the .z.pc function, kdb+

I have to log disconnects and I am defining a .z.pc function to do this. However, I'm unsure how to best to get the handle of the process that has disconnected. I do record the handle and host, when it connects, using the .z.po function. Any insight would be appreciated.

My function looks like this:

.z.pc:{handles,:(.z.t;.z.h;.z.w;"d")}

The issue is the function is triggered after disconnect so .z.w has to be an historic value.

Upvotes: 0

Views: 211

Answers (1)

terrylynch
terrylynch

Reputation: 13657

The implicit "x" variable inside .z.pc is the handle of the disconnected process

Upvotes: 3

Related Questions