from time import ctime
from socket import *
from ctypes import *
import struct
HOST = '192.168.10.140'
PORT = 6368
BUFSIZ = 8192
ADDR = (HOST, PORT)
tcpCliSock = socket(AF_INET, SOCK_STREAM)
tcpCliSock.connect(ADDR)
f = open("wave_3ph_50k.bin", "wb")
while True:
dat = tcpCliSock.recv(BUFSIZ)
f.write(dat)
print(tcpCliSock.close())