import socketHOST = "127.0.0.1"PORT = 5000mySocket = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )mySocket.bind( ( HOST, PORT ) )while 1: packet, address = mySocket.recvfrom( 1024 ) print "From host:", address[ 0 ] print "Host port:", address[ 1 ] print "Length:", len( packet ) print "t" + packet mySocket.sendto( packet, address ) print "Packet sentn"mySocket.close()
Name (required)
email (will not be published) (required)
Website