sending socket data as hex?
horst last edited by horst
with send() I can only send strings, right? But I want to send hex data, how can I do this?
My sample code:
host = '192.168.4.2' # laptop running server
port = 2004
addr = socket.getaddrinfo(host, port)[-1]
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.send('ffff') <- at this point I don't want to send ffff as text but as hex
You should use binary data.
For binary use the following format.
Or do you want this?