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
22 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,920 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,340 points
87 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
81 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
973 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,520 points

edited Dec 19, 2018 by Nymeria 10,016 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,520 points
468 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 in Python by Mohammad
• 3,060 points
29 views
0 votes
1 answer
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,920 points
11 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,920 points
90 views