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
2,634 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,960 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,460 points
1,373 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,270 points
2,107 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
8,128 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,480 points
107,746 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,560 points
8,310 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
1,987 views
–1 vote
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,960 points
4,757 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,960 points
16,234 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP