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 in Python by Nisa
• 1,090 points
16 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 by Wajiha
• 1,120 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 ariaholic
• 7,320 points
58 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 in Python by rajesh
• 1,210 points
63 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
634 views
0 votes
1 answer

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

You don't need to change your existing ...READ MORE

answered Dec 3, 2018 in Python by Nymeria
• 3,500 points

edited Dec 19, 2018 by Nymeria 6,798 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 in Python by Nymeria
• 3,500 points
294 views
0 votes
0 answers

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

I am getting the error stating - ...READ MORE

Jun 26 in Python by Waseem
• 3,480 points
20 views
+1 vote
2 answers

How to resize the image canvas to maintain a square aspect ratio

down voteacceptedUsing OpenCVYou can use resize() in OpenCV to ...READ MORE

answered Apr 4, 2018 in Python by charlie_brown
• 7,710 points
149 views
0 votes
1 answer

What does AF_INET mean?

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

answered Jul 3 in Python by Wajiha
• 1,120 points
7 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 in Python by Wajiha
• 1,120 points
17 views