Skip to content

Instantly share code, notes, and snippets.

@ahmedfgad
Created June 23, 2020 19:37
Show Gist options
  • Select an option

  • Save ahmedfgad/71ab4008054b7306cfdc1f6cb04dc53d to your computer and use it in GitHub Desktop.

Select an option

Save ahmedfgad/71ab4008054b7306cfdc1f6cb04dc53d to your computer and use it in GitHub Desktop.
import time
def recv(connection, buffer_size, recv_timeout):
received_data = b""
while (received_data)[-2] != '.':
try:
data = connection.recv(buffer_size)
received_data += data
except BaseException as e:
print("Error Receiving Data from the Client: {msg}.\n".format(msg=e))
return None, 0
return received_data, 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment