Untitled

mail@pastecode.io avatar
unknown
python
a year ago
322 B
3
Indexable
Never
import socket
import binascii

HOST = "127.0.0.1"  # The server's hostname or IP address
PORT = 65432  # The port used by the server
MESSAGE = b'\x09\x00\x09'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.sendall(MESSAGE)
data = s.recv(1024)

print "Received %s" % binascii.hexlify(data)