diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-05 21:54:04 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-05 21:54:04 +0000 |
commit | 4700398e384f38f752b432e187462f404b96847d (patch) | |
tree | 581e9d76947deae9644e1a241e0aa12df0783aff /runtime/tools | |
parent | 12f3c1b77fb39dc338304d5484cdbc99da27389a (diff) |
Update runtime files
Diffstat (limited to 'runtime/tools')
-rw-r--r-- | runtime/tools/demoserver.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/tools/demoserver.py b/runtime/tools/demoserver.py index 00fe8bfbca..150ddbee7c 100644 --- a/runtime/tools/demoserver.py +++ b/runtime/tools/demoserver.py @@ -62,9 +62,16 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): if decoded[0] >= 0: if decoded[1] == 'hello!': response = "got it" + id = decoded[0] + elif decoded[1] == 'hello channel!': + response = "got that" + # response is not to a specific message callback but to the + # channel callback, need to use ID zero + id = 0 else: response = "what?" - encoded = json.dumps([decoded[0], response]) + id = decoded[0] + encoded = json.dumps([id, response]) print("sending {0}".format(encoded)) self.request.sendall(encoded.encode('utf-8')) thesocket = None |