hclose and .z.W

Hello,

As a client, I connect to a server inside a function, and based on some logic (let’s say you exceeded # of connections you are allowed to have), the server force closes the client connection. From within the function, I want to know if the handle is still valid.

Server


.z.po:{hclose .z.w}

Client


f:{h:@[{(hopen x;“”)};(`$“::12346”);{0Ni;x}];1"h->“,string[h 0],”, .z.W->",.Q.s key .z.W;}

f

h->4, .z.W->3 4i

.z.W doesn’t get updated until the function completes. If there are other tables getting updated based on .z.W info, they all will end up with incorrect information until the function completes. If this function is nested 10 levels deep, it makes it more complicated. Any elegant way to check this?

Tks,

–N