Created
June 23, 2020 19:37
-
-
Save ahmedfgad/71ab4008054b7306cfdc1f6cb04dc53d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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