How to send information greater than buffer size from server to the client

0 votes
When I use a small buffer size, the client gets terminated even before the complete message is received. What should I do to receive the complete message?
Jun 27, 2019 in Python by Nisa
• 1,090 points
536 views

1 answer to this question.

0 votes
complete_info=''
while True:
    msg = s.recv(2)  # here 1024 is a buffer which specifies how many chunks of data we can recieve at a prticulat time(can be increased if the files to be transferred are huge)
    if len(msg)<=0:
        break
    complete_info+=msg.decode("utf-8")
print(complete_info)
answered Jun 27, 2019 by Wajiha
• 1,950 points

Related Questions In Python

0 votes
1 answer

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

answered Jun 4, 2018 in Python by aryya
• 7,440 points
407 views
–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

answered Mar 29, 2019 in Python by rajesh
• 1,230 points
474 views
+5 votes
0 answers

How to send sms to users from Django application?

I'm looking for an option to send ...READ MORE

Nov 13, 2018 in Python by Manu
• 170 points
5,430 views
0 votes
3 answers

How to get the return value from a thread using python?

FWIW, the multiprocessing module has a nice interface for ...READ MORE

answered Dec 15, 2020 in Python by Roshni
• 10,420 points
57,786 views
0 votes
1 answer

How to use read a WSDL file from the file system using Python suds?

Hi, good question. It is a very simple ...READ MORE

answered Jan 21, 2019 in Python by Nymeria
• 3,520 points
3,921 views
0 votes
1 answer

How to resolve the error while importing cv2 from openCV in python?

I would recommend you go with anaconda ...READ MORE

answered Jul 31, 2019 in Python by Mohammad
• 3,230 points
633 views
0 votes
2 answers
0 votes
1 answer

What does AF_INET mean?

AF_INET refers to Address from the Internet ...READ MORE

answered Jul 3, 2019 in Python by Wajiha
• 1,950 points
908 views
0 votes
1 answer

How to check if a website allows web scraping?

To check if a website allows web ...READ MORE

answered Jun 14, 2019 in Python by Wajiha
• 1,950 points
7,837 views