RE: [GD-General] UDP questions
Brought to you by:
vexxed72
|
From: Jaek S. <smi...@cs...> - 2002-07-01 20:18:11
|
> Given the feedback from you and others, however, it looks either
> Beej's
> comments are wrong, or what he defines as a "packet" is something other
> than a UDP packet (e.g. his own packet structure, etc.) and thus
> possibly something that can become fragmented. From looking at it,
> though, it doesn't seem to be the case (i.e. the example he gives of a
> simple chat protocol shouldn't have a case where it fragments at the
> application level).
Taking an extremely quick look at the link you sent, it looks like the methods he is showing are for a stream (TCP) socket, and not a datagram (UDP) socket. Ex:
if ((listener = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
Thus... he is probably doing a message-over stream based protocol.
Calling recv will receive a single, complete datagram. However, the following may be true (does someone want to verify these):
- It may not be unique
- It may be corrupt
- It may be out of order
Later for now
--Jaek
|