Created
January 23, 2020 10:27
-
-
Save BMU-Verlag/bc9565f596af1ce104ad8847d84f4ba6 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
IP = '127.0.0.1' | |
PORT = 5555 | |
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
server_socket.bind((IP, PORT)) | |
server_socket.listen() | |
print (f'Listeing on {IP}:{PORT}') | |
all_sockets = [server_socket] | |
while True: | |
client_socket, client_address = server_socket.accept() | |
print(f'Established connection to {client_address[0]}:{client_address[1]}') | |
all_sockets.append(client_socket) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment