Created
September 29, 2012 09:27
-
-
Save mike-zhang/3803560 to your computer and use it in GitHub Desktop.
a simple udp client (python code)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# a simple udp client | |
import socket,time,traceback | |
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
dstHost = ('192.168.1.100', 12345) | |
while True: | |
try: | |
client.sendto('3',dstHost) | |
print time.time(),' : send success' | |
#print time.time()," : ",client.recv(1024) | |
time.sleep(3) | |
except: | |
traceback.print_exc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment