How to use sockets?

Mark Wieder mwieder at ahsoftware.net
Thu Nov 18 15:32:42 EST 2004


thierry-

Thursday, November 18, 2004, 3:28:37 AM, you wrote:

t> i've read in some technical books that Datagram is not a sure way
t> to send information; means that some transport packets can be lost
t> over the Net.

t> Can someone tell me if it's still true on a single Win machine with
t> 2 applications talking together with Datagram sockets ?

t> or pointing some good information on this ?

It's not an OS thing: TCP is one level up in the OSI network hierarchy
from UDP. UDP Datagram packets are the lowest level in which you can
package data and specify a recipient on the network, but there's no
mechanism to define either a packet sequence or a handshake protocol.
Both these things are in the TCP level. If you're comfortable with
some packets possibly arriving out of order (you handle all this
yourself) and are creating your own protocol for determining when
packets have arrived safely then datagrams are *much* faster than TCP
packets. If you're sending individual datagram packets rather than
multi-packet transactions and do some simple handshaking then you're
safe with datagrams. They're used quite a bit for control packets
where small amounts of data need to be sent quickly.

Do a web search for the OSI network model - here's a quick sample:
http://www.webopedia.com/quick_ref/OSI_Layers.asp

You'll find datagrams at layer 3 and TCP at layer 4.

All you need to know about datagrams:
http://www.faqs.org/rfcs/rfc768.html

-- 
-Mark Wieder
 mwieder at ahsoftware.net



More information about the use-livecode mailing list