<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Python &#8211; How to Receive Full Data with the recv() Socket function	</title>
	<atom:link href="https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/</link>
	<description>News, Technology, Entertainment and more</description>
	<lastBuildDate>Mon, 23 May 2022 16:06:50 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		By: Anibal		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-337513</link>

		<dc:creator><![CDATA[Anibal]]></dc:creator>
		<pubDate>Mon, 23 May 2022 16:06:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-337513</guid>

					<description><![CDATA[In Python 3.8 this line doesn&#039;t work:

    return &#039;&#039;.join(total_data)

It throws:

    return &#039;&#039;.join(total_data)
TypeError: sequence item 0: expected str instance, bytes found

My data is a bunch of characters (not binary data), but I have control characters in the stream.

And if I replace it with:

    return &#039;&#039;.join(str(total_data))

I&#039;m basically changing the control character \x0b to a literal string with a backslash, followed by x, followed by 0 and then b. That&#039;s not what I want. Not sure how to address this.]]></description>
			<content:encoded><![CDATA[<p>In Python 3.8 this line doesn&#8217;t work:</p>
<p>    return &#8221;.join(total_data)</p>
<p>It throws:</p>
<p>    return &#8221;.join(total_data)<br />
TypeError: sequence item 0: expected str instance, bytes found</p>
<p>My data is a bunch of characters (not binary data), but I have control characters in the stream.</p>
<p>And if I replace it with:</p>
<p>    return &#8221;.join(str(total_data))</p>
<p>I&#8217;m basically changing the control character \x0b to a literal string with a backslash, followed by x, followed by 0 and then b. That&#8217;s not what I want. Not sure how to address this.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: cyberthereaper		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-295330</link>

		<dc:creator><![CDATA[cyberthereaper]]></dc:creator>
		<pubDate>Tue, 17 Nov 2020 17:56:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-295330</guid>

					<description><![CDATA[I solved the problem with a simple method. i am using python3.8

After extracting the data with s.recv (4096), do the following.

results = s.recv(4096)

while (len(results) &#062; 0):
    print(results)
    results = s.recv(4096)

the above command will give you all the data]]></description>
			<content:encoded><![CDATA[<p>I solved the problem with a simple method. i am using python3.8</p>
<p>After extracting the data with s.recv (4096), do the following.</p>
<p>results = s.recv(4096)</p>
<p>while (len(results) &gt; 0):<br />
    print(results)<br />
    results = s.recv(4096)</p>
<p>the above command will give you all the data</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Silver Moon		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-282675</link>

		<dc:creator><![CDATA[Silver Moon]]></dc:creator>
		<pubDate>Mon, 28 Sep 2020 16:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-282675</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-282201&quot;&gt;Eduardo&lt;/a&gt;.

yes you are correct.
the code is not fully compatible with python 3.
it needs to be edited.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-282201">Eduardo</a>.</p>
<p>yes you are correct.<br />
the code is not fully compatible with python 3.<br />
it needs to be edited.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eduardo		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-282201</link>

		<dc:creator><![CDATA[Eduardo]]></dc:creator>
		<pubDate>Sun, 27 Sep 2020 01:10:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-282201</guid>

					<description><![CDATA[SADLY. This doesn&#039;t work in python 3. You have to decode I you will get errors by doing all at once]]></description>
			<content:encoded><![CDATA[<p>SADLY. This doesn&#8217;t work in python 3. You have to decode I you will get errors by doing all at once</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: supra		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-268492</link>

		<dc:creator><![CDATA[supra]]></dc:creator>
		<pubDate>Tue, 28 Jul 2020 11:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-268492</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-104450&quot;&gt;Andres A&lt;/a&gt;.

How do you called recv_timeout function to socket?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-104450">Andres A</a>.</p>
<p>How do you called recv_timeout function to socket?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rufus V. Smith		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-129491</link>

		<dc:creator><![CDATA[Rufus V. Smith]]></dc:creator>
		<pubDate>Wed, 06 Sep 2017 19:58:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-129491</guid>

					<description><![CDATA[I&#039;m not sure the comment on the time.sleep(0.1) between read requests is really appropriate.   I don&#039;t believe it is to &quot;indicate a gap&quot;,  it is probably to reduce load on the CPU caused by spinning for new data (I&#039;ve written a lot of code like this).  If you remove that time, you&#039;ll see the CPU load on your computer skyrocket, perhaps to 100% for no reason.  The code is quite good however.  The only other comment I have is the &quot;Wait for any data&quot; and &quot;wait for end of data&quot; should probably each have their own values, not for one to be twice the other.   Usually the &quot;Wait for any data&quot; can be quite long, and the &quot;wait for end of data&quot; is quite short.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure the comment on the time.sleep(0.1) between read requests is really appropriate.   I don&#8217;t believe it is to &#8220;indicate a gap&#8221;,  it is probably to reduce load on the CPU caused by spinning for new data (I&#8217;ve written a lot of code like this).  If you remove that time, you&#8217;ll see the CPU load on your computer skyrocket, perhaps to 100% for no reason.  The code is quite good however.  The only other comment I have is the &#8220;Wait for any data&#8221; and &#8220;wait for end of data&#8221; should probably each have their own values, not for one to be twice the other.   Usually the &#8220;Wait for any data&#8221; can be quite long, and the &#8220;wait for end of data&#8221; is quite short.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-114717</link>

		<dc:creator><![CDATA[James]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 02:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-114717</guid>

					<description><![CDATA[This is better than any answer on Stackoverflow by a long shot.]]></description>
			<content:encoded><![CDATA[<p>This is better than any answer on Stackoverflow by a long shot.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-114716</link>

		<dc:creator><![CDATA[James]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 02:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-114716</guid>

					<description><![CDATA[This works great! Totally solved my problem.]]></description>
			<content:encoded><![CDATA[<p>This works great! Totally solved my problem.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ben		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-107404</link>

		<dc:creator><![CDATA[Ben]]></dc:creator>
		<pubDate>Tue, 28 Feb 2017 02:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-107404</guid>

					<description><![CDATA[Hello, i have a question. Is there a reason 8192 is used as the number in recv? What&#039;s its advantage to putting any other number there?]]></description>
			<content:encoded><![CDATA[<p>Hello, i have a question. Is there a reason 8192 is used as the number in recv? What&#8217;s its advantage to putting any other number there?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shuvo		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-107009</link>

		<dc:creator><![CDATA[Shuvo]]></dc:creator>
		<pubDate>Sat, 25 Feb 2017 01:27:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-107009</guid>

					<description><![CDATA[What modification can be done in this code in order to download a webpage pointed by a URL and all the image objects associated with the base html?]]></description>
			<content:encoded><![CDATA[<p>What modification can be done in this code in order to download a webpage pointed by a URL and all the image objects associated with the base html?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ab1		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-106518</link>

		<dc:creator><![CDATA[ab1]]></dc:creator>
		<pubDate>Tue, 21 Feb 2017 07:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-106518</guid>

					<description><![CDATA[Thank you, the only complete example that works!]]></description>
			<content:encoded><![CDATA[<p>Thank you, the only complete example that works!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andres A		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-104450</link>

		<dc:creator><![CDATA[Andres A]]></dc:creator>
		<pubDate>Thu, 02 Feb 2017 17:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-104450</guid>

					<description><![CDATA[I just added your recv_timeout function to mine and works perfect! Thanks!]]></description>
			<content:encoded><![CDATA[<p>I just added your recv_timeout function to mine and works perfect! Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ryan		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-93296</link>

		<dc:creator><![CDATA[Ryan]]></dc:creator>
		<pubDate>Sat, 10 Sep 2016 01:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-93296</guid>

					<description><![CDATA[Thank you.
Thank you so much.]]></description>
			<content:encoded><![CDATA[<p>Thank you.<br />
Thank you so much.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ibrah		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-87876</link>

		<dc:creator><![CDATA[Ibrah]]></dc:creator>
		<pubDate>Sun, 10 Jul 2016 08:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-87876</guid>

					<description><![CDATA[ fell in love with you code]]></description>
			<content:encoded><![CDATA[<p> fell in love with you code</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hurin		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-67246</link>

		<dc:creator><![CDATA[Hurin]]></dc:creator>
		<pubDate>Wed, 23 Jul 2014 10:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-67246</guid>

					<description><![CDATA[I love you. You just perfectly solved the problem I had with this explanation. Thanks!]]></description>
			<content:encoded><![CDATA[<p>I love you. You just perfectly solved the problem I had with this explanation. Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: VectorEQ		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-66258</link>

		<dc:creator><![CDATA[VectorEQ]]></dc:creator>
		<pubDate>Thu, 19 Jun 2014 13:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-66258</guid>

					<description><![CDATA[if you get a 302 redirect just make another request. the redirect will contain the url you need to be redirected too. run the same thing ,but have it point to the redirect url.]]></description>
			<content:encoded><![CDATA[<p>if you get a 302 redirect just make another request. the redirect will contain the url you need to be redirected too. run the same thing ,but have it point to the redirect url.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: berebere		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-66115</link>

		<dc:creator><![CDATA[berebere]]></dc:creator>
		<pubDate>Sun, 27 Apr 2014 09:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-66115</guid>

					<description><![CDATA[This is very interesting...How do I get a full data like that to be displayed on a broswer..??]]></description>
			<content:encoded><![CDATA[<p>This is very interesting&#8230;How do I get a full data like that to be displayed on a broswer..??</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Vishal		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-65987</link>

		<dc:creator><![CDATA[Vishal]]></dc:creator>
		<pubDate>Wed, 19 Feb 2014 03:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-65987</guid>

					<description><![CDATA[First of all a lot of Thanks for this beautiful and lucid post. Helps in clarifying lot of stuff so quickly! Great Job!

I have one question on the response returned from the server:

If you see the response returned is a 302:
................................................
302 Moved
The document has moved
................................................

Now browsers will do an auto forward and urllib2 library also has classes to handle the redirects, but I want to know how can this be natively handled via Sockets. I am getting 302 for almost all the sites.

Any help is much appreciated!]]></description>
			<content:encoded><![CDATA[<p>First of all a lot of Thanks for this beautiful and lucid post. Helps in clarifying lot of stuff so quickly! Great Job!</p>
<p>I have one question on the response returned from the server:</p>
<p>If you see the response returned is a 302:<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br />
302 Moved<br />
The document has moved<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>Now browsers will do an auto forward and urllib2 library also has classes to handle the redirects, but I want to know how can this be natively handled via Sockets. I am getting 302 for almost all the sites.</p>
<p>Any help is much appreciated!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anton		</title>
		<link>https://www.binarytides.com/receive-full-data-with-the-recv-socket-function-in-python/comment-page-1/#comment-65939</link>

		<dc:creator><![CDATA[Anton]]></dc:creator>
		<pubDate>Thu, 23 Jan 2014 14:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=2441#comment-65939</guid>

					<description><![CDATA[have no idea why, but it works. Thanks.]]></description>
			<content:encoded><![CDATA[<p>have no idea why, but it works. Thanks.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
