Created
January 21, 2020 13:17
-
-
Save BMU-Verlag/7032175ba570db98bb00aaf5773a48bb to your computer and use it in GitHub Desktop.
This file contains 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
# client.py | |
from header_utils import HEADER_SIZE | |
import socket | |
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
client_socket.connect((socket.gethostname(), 5555)) | |
while True: | |
message_size = client_socket.recv(HEADER_SIZE) | |
if message_size: | |
message_size = int(message_size.strip()) | |
message = client_socket.recv(message_size) | |
print(message.decode('utf-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment