sk = socket.socket()
sk.connect(self.ip_port)
sk.settimeout(5)
sk.sendall(b'ZBXDx01')
sk.sendall(b'Qx00x00x00x00x00x00x00')
sk.sendall(b'{"request":"sender data","data":[{"host":"127.0.0.1","key":"abc","value":"123"}]}')
try:
a = sk.recv(1024).decode('ascii')
except:
return 0
else:
return 1