Feb-01-2019, 11:21 AM
(This post was last modified: Feb-01-2019, 11:22 AM by cetpaseo336.)
hello
write a socket programming with python to send and recive a file over tcp
Here is a part to send a part of data based on the size of the buffer.
msg[i] = file[i].read()
file[i].close()
while 1:
tdata[i], msg[i] = msg[i][:buf], msg[i][buf:]
c.send(tdata[i])
if len(msg[i]) < buf:
break
write a socket programming with python to send and recive a file over tcp
Here is a part to send a part of data based on the size of the buffer.
msg[i] = file[i].read()
file[i].close()
while 1:
tdata[i], msg[i] = msg[i][:buf], msg[i][buf:]
c.send(tdata[i])
if len(msg[i]) < buf:
break