File: printreq.py

package info (click to toggle)
rust-condure 1.10.0-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,384 kB
  • sloc: python: 345; makefile: 10
file content (13 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
# this handler just outputs the request ID

import tnetstring
import zmq

ctx = zmq.Context()
sock = ctx.socket(zmq.PULL)
sock.connect('ipc://client-out')

while True:
    m = sock.recv_multipart()
    req = tnetstring.loads(m[0][1:])
    print('{} {}'.format(req[b'from'].decode(), req[b'id'].decode()))