Skip to content

Instantly share code, notes, and snippets.

@Adarshreddyash
Last active September 7, 2019 02:46
Show Gist options
  • Save Adarshreddyash/b27c3de3c04c937c37e35aecbb112c02 to your computer and use it in GitHub Desktop.
Save Adarshreddyash/b27c3de3c04c937c37e35aecbb112c02 to your computer and use it in GitHub Desktop.
import socket
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('localhost', 5000))
serversocket.listen(5)
while True:
connection, address = serversocket.accept()
buffer = connection.recv(68)
if len(buffer) > 0:
print(buffer)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment