Skip to content

Instantly share code, notes, and snippets.

@ahmedfgad
Created June 23, 2020 19:40
Show Gist options
  • Save ahmedfgad/f261b9ad8dbcce249c20eca4ef4c69cf to your computer and use it in GitHub Desktop.
Save ahmedfgad/f261b9ad8dbcce249c20eca4ef4c69cf to your computer and use it in GitHub Desktop.
msg = "Another message from the client."
msg = pickle.dumps(msg)
soc.sendall(msg)
print("Client sent a message to the server.")
received_data = b''
while str(received_data)[-2] != '.':
data = soc.recv(8)
received_data += data
received_data = pickle.loads(received_data)
print("Received data from the client: {received_data}".format(received_data=received_data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment