aboutsummaryrefslogtreecommitdiff
path: root/pipermail/nel/2001-March/000352.html
diff options
context:
space:
mode:
Diffstat (limited to 'pipermail/nel/2001-March/000352.html')
-rw-r--r--pipermail/nel/2001-March/000352.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/pipermail/nel/2001-March/000352.html b/pipermail/nel/2001-March/000352.html
new file mode 100644
index 00000000..def14384
--- /dev/null
+++ b/pipermail/nel/2001-March/000352.html
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [Nel] newbies about packet schema</TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:kjd%40cs.stanford.edu">
+ <LINK REL="Previous" HREF="000338.html">
+ <LINK REL="Next" HREF="000339.html">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[Nel] newbies about packet schema</H1>
+ <B>Kenneth Duda</B>
+ <A HREF="mailto:kjd%40cs.stanford.edu"
+ TITLE="[Nel] newbies about packet schema">kjd@cs.stanford.edu</A><BR>
+ <I>Sat, 3 Mar 2001 02:02:34 -0800</I>
+ <P><UL>
+ <LI> Previous message: <A HREF="000338.html">[Nel] newbies about packet schema</A></li>
+ <LI> Next message: <A HREF="000339.html">[Nel] compile.cpp</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#352">[ date ]</a>
+ <a href="thread.html#352">[ thread ]</a>
+ <a href="subject.html#352">[ subject ]</a>
+ <a href="author.html#352">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>&gt;<i> I have read artice for winsock program, if folling article is
+</I>&gt;<i> true, that snow ball netowrk driver , should change it's packet
+</I>&gt;<i> schema. any one can give me suggect ?
+</I>
+I am not familiar with the snowball protocol (&quot;packet schema&quot;).
+However, I assure you that the article is correct --- attempting
+to turn TCP from a byte stream into a sequenced message stream by
+disabling Nagle will not work. The only way to implement message
+semantics on top of TCP is to add your own packetization to the
+byte stream. For example,
+
+
+ void SendMessage( int socket, const void * buf, size_t length )
+ {
+ long l = htonl( length );
+ write( socket, &amp;l, 4 );
+ write( socket, buf, length );
+ }
+
+ void RecvMessage( int socket, void * buf, size_t * length )
+ {
+ long l;
+ read( socket, &amp;l, 4 );
+ l = ntohl( l );
+ assert( l &lt; *length );
+ *length = l;
+ read( socket, buf, length );
+ }
+
+
+-Ken
+
+Kenneth J. Duda
+Stanford University Distributed Systems Group
+&lt;<A HREF="mailto:kjd@cs.stanford.edu">kjd@cs.stanford.edu</A>&gt;
+
+
+</pre>
+
+<!--endarticle-->
+ <HR>
+ <P><UL>
+ <!--threads-->
+ <LI> Previous message: <A HREF="000338.html">[Nel] newbies about packet schema</A></li>
+ <LI> Next message: <A HREF="000339.html">[Nel] compile.cpp</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#352">[ date ]</a>
+ <a href="thread.html#352">[ thread ]</a>
+ <a href="subject.html#352">[ subject ]</a>
+ <a href="author.html#352">[ author ]</a>
+ </LI>
+ </UL>
+</body></html>