Python Forum
How to send/receive data over TCP
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to send/receive data over TCP
#2
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
Reply


Messages In This Thread
How to send/receive data over TCP - by Rehan11 - Dec-29-2018, 06:39 PM
RE: How to send/receive data over TCP - by cetpaseo336 - Feb-01-2019, 11:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Listen TCP and send data to websockets neoboby 3 3,018 Feb-13-2023, 09:47 PM
Last Post: Vadanane
  Send Pressure sensor data to IoT platform using WebSockets in Python barry76 3 4,631 Mar-12-2019, 09:48 AM
Last Post: barry76
  Send data BMP180 between client and server trought module socket smalhao 0 2,838 Jul-30-2018, 12:56 PM
Last Post: smalhao
  Python socket : Error receive data quanglnh1993 1 13,018 Mar-14-2018, 11:59 AM
Last Post: avorane
  Socket won't receive data suddenly with multiple clients SquareRoot 0 2,788 Sep-06-2017, 09:09 PM
Last Post: SquareRoot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020