+# ----- receiver.py -----
+
+#!/usr/bin/env python
+
+from socket import *
+import sys
+import select
+import time
+
+host="0.0.0.0"
+port = 9999
+s = socket(AF_INET,SOCK_DGRAM)
+s.bind((host,port))
+
+addr = (host,port)
+buf=1024
+
+
+data,addr = s.recvfrom(buf)
+elapsed_time=0
+t = time.time()
+print("Received File:",data.decode().strip())
+f = open(data.decode().strip()+"2",'wb')
+
+data,addr = s.recvfrom(buf)
+try:
+ while(data):
+ f.write(data)
+ s.settimeout(2)
+ data,addr = s.recvfrom(buf)
+except timeout:
+ s.close()
+ f.close()
+# print("File Downloaded")
+elapsed_time += time.time() - t
+
+print("receive bmp",elapsed_time)