Created
January 21, 2020 13:15
-
-
Save BMU-Verlag/39c6fbd0c1e3fd2e0de85e12dd49dcdb 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
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