<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simple Message Framing Sample for TCP Socket - Part 2 (Asynchronous)</title><link>http://blogs.msdn.com/joncole/archive/2006/04/25/simple-message-framing-sample-for-tcp-socket-part-2-asynchronous.aspx</link><description>As a follow up to my last post ( http://blogs.msdn.com/joncole/archive/2006/03/20/555721.aspx ) I decided to add some sample code for implementing an asynchronous version of ReadMessage. All of the same rules apply as discussed in my previous post, but</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Simple Message Framing Sample for TCP Socket - Part 2 (Asynchronous)</title><link>http://blogs.msdn.com/joncole/archive/2006/04/25/simple-message-framing-sample-for-tcp-socket-part-2-asynchronous.aspx#913917</link><pubDate>Tue, 31 Oct 2006 21:25:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:913917</guid><dc:creator>edward</dc:creator><description>&lt;P&gt;Hi, &lt;/P&gt;
&lt;P&gt;if (state.bytesReceived == 4)//we have received the entire message size information&lt;/P&gt;
&lt;P&gt;How could you make sure the recieve byte number is less than or equal to 4, if the first time, the count is more than 4, so what will happen?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description></item><item><title>re: Simple Message Framing Sample for TCP Socket - Part 2 (Asynchronous)</title><link>http://blogs.msdn.com/joncole/archive/2006/04/25/simple-message-framing-sample-for-tcp-socket-part-2-asynchronous.aspx#1186357</link><pubDate>Fri, 01 Dec 2006 23:10:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1186357</guid><dc:creator>joncole</dc:creator><description>&lt;p&gt;When the first BeginReceive is started, the buffer passed in is only 4 bytes in size. &amp;nbsp;This means that we can't receive more than 4 bytes, making it possible to use this logic. &amp;nbsp;If we were trying to build a more performant system, we wouldn't use just 4 bytes for the buffer and we would have to check for more than 4 bytes being received. &amp;nbsp;I wrote it this way to simplify the example code for the purposes of this sample.&lt;/p&gt;
</description></item></channel></rss>