sending/receiving file UDP in python
问题 I've made this sending / receiving scripts but i corrupted file ! i have no idea why I'm getting this issue ! sender.py #!/usr/bin/env python from socket import * import sys s = socket(AF_INET,SOCK_DGRAM) host =sys.argv[1] port = 9999 buf =1024 addr = (host,port) file_name=sys.argv[2] f=open(file_name,"rb") data = f.read(buf) s.sendto(file_name,addr) s.sendto(data,addr) while (data): if(s.sendto(data,addr)): print "sending ..." data = f.read(buf) s.close() f.close() receiver.py #!/usr/bin/env