UDP Inetd Server : inetd « Network « Python Tutorial






import socket, time, sys

s = socket.fromfd(sys.stdin.fileno(), socket.AF_INET, socket.SOCK_DGRAM)
message, address = s.recvfrom(8192)
s.connect(address)
for i in range(10):
    s.send("Reply %d: %s" % (i + 1, message))
    time.sleep(2)
s.send("OK, I'm done sending replies.\n")








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