Last active
December 10, 2019 03:57
-
-
Save NimishMishra/286d6616e049077e4a2a8fb525949b74 to your computer and use it in GitHub Desktop.
A very basic skeleton of a socket server
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
import socket | |
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
connection.bind((socket.gethostname(), 8000)) | |
connection.listen(5) | |
while True: | |
connectedsocket, address = connection.accept() | |
print("Connection from {address} established".format(address = address)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment