diff options
Diffstat (limited to 'runtime/tools/demoserver.py')
-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 |