Re: Can recvfrom() return more than 1 packet?
- From: Robert Harris <robert.f.harris@xxxxxxxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 23:29:03 GMT
David Schwartz wrote:
Robert Harris wrote:
Yes. If a UDP datagram is too large to fit in a single packet, it will
be sent in as many packets as needed and they will be re-assembled
before you receive them.
A fragment is a fragment: a fragment of a packet, not a packet. A UDP
datagram is a (one) IP packet.
I'm afraid you are mistaken. The IP layer fragments UDP datagrams into
as many IP packets as are needed. These IP packets are then reassembled
back into the original datagram.
Read RFC791, the specification for IP itself. It contains the following
excerpts:
[snip]
OK. The official term for a "whole" IP packet is a datagram. But,
getting back to the original post, what you get when you call recvfrom()
on a SOCK_DGRAM socket is the (possibly reassambled) datagram, not a
fragment thereof.
Robert
.
- Follow-Ups:
- Re: Can recvfrom() return more than 1 packet?
- From: David Schwartz
- Re: Can recvfrom() return more than 1 packet?
- References:
- Can recvfrom() return more than 1 packet?
- From: Boltar
- Re: Can recvfrom() return more than 1 packet?
- From: David Schwartz
- Re: Can recvfrom() return more than 1 packet?
- From: Robert Harris
- Re: Can recvfrom() return more than 1 packet?
- From: David Schwartz
- Can recvfrom() return more than 1 packet?
- Prev by Date: Re: link a c compiled application with a c++ compiled library ?
- Next by Date: Re: Can recvfrom() return more than 1 packet?
- Previous by thread: Re: Can recvfrom() return more than 1 packet?
- Next by thread: Re: Can recvfrom() return more than 1 packet?
- Index(es):
Relevant Pages
|