Socket-based inetd server : inetd « Network « Python Tutorial






import sys, socket, time
s = socket.fromfd(sys.stdin.fileno(), socket.AF_INET, socket.SOCK_STREAM)
s.sendall("Welcome.\n")
s.sendall("connected from %s.\n" % str(s.getpeername()))
s.sendall("The local time is %s.\n" % time.asctime())








21.7.inetd
21.7.1.Basic inetd server
21.7.2.Socket-based inetd server
21.7.3.UDP Inetd Server
21.7.4.UDP Inetd Server for Wait