Deferred synchronous request

I was trying to do a deferred synchronous request, by sending an async request and immediately receiving the response. However it failed and there was no response message. Can anyone please help and see what I have done wrong? I am using version 3.4 2016.10.10 l32 .

Instance #1

=========

q)test:( a:til 10)

q)\p 6000

q)

Instance #2

=========

q)h:hopen 6000

q)h"test"

a

0

1

2

3

4

5

6

7

8

9

q)neg[h]“test” ; h

(keep waiting but no response)

When you send an async request, the server sees it, executes it, and doesn’t automatically send anything back to the client. This causes your blocked handle to wait forever. So what you’d want to do here is tell the server to talk back with something like this:

neg[h]({neg[.z.w] value x};“test”);h

which tells the server to do it’s own async message back to you with the value of your request.