Skip to content

Instantly share code, notes, and snippets.

@Rajdeep-Das
Last active May 4, 2019 21:03
A Simple TCP Server
from socket import *
s = socket(AF_INET, SOCK_STREAM)
s.bind(("",9999))
s.listen(5)
while True:
c,a = s.accept()
print "Hey I received connection from", a
c.send("Hi buddy %s\n" %a[0])
c.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment