testing
This commit is contained in:
21
client.py
Normal file
21
client.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import zmq
|
||||
|
||||
context = zmq.Context()
|
||||
socket = context.socket(zmq.REQ)
|
||||
socket.connect('ipc:///run/user/1000/guestfs-inspect.sock')
|
||||
|
||||
tt = 1
|
||||
tt_size = 1
|
||||
|
||||
message = "test"
|
||||
socket.send(message.encode('utf-8'), flags=zmq.SNDMORE)
|
||||
socket.send(tt.to_bytes(4, 'little'), flags=zmq.SNDMORE)
|
||||
socket.send(tt_size.to_bytes(8, 'little'), flags=zmq.SNDMORE)
|
||||
socket.send('/etc/os-release'.encode('utf-8'), flags=zmq.SNDMORE)
|
||||
socket.send(''.encode('utf-8'))
|
||||
|
||||
message = socket.recv()
|
||||
print(message.decode('utf-8'))
|
||||
|
||||
socket.close()
|
||||
context.destroy()
|
||||
Reference in New Issue
Block a user