from socket import *HOST = 'localhost'PORT = 21567BUFSIZ = 1024ADDR = (HOST, PORT)udpCliSock = socket(AF_INET, SOCK_DGRAM)while True: data = 'data' if not data: break udpCliSock.sendto(data, ADDR) data, ADDR = udpCliSock.recvfrom(BUFSIZ) if not data: break print dataudpCliSock.close()udpCliSock.close()
Name (required)
email (will not be published) (required)
Website