Is this on Ethernet, or a PPP connection? Are you using a packet sniffer to
determine this? Actually, I calculate you should be sending a lot more than that
on the physical network...
> Is it because it's including the the sockaddr_in struct of of the socket
> that's sending the data? If so, if I call sizeof() on the struct, will the
> value vary on diff platforms?
UDP is built on top of IP. The IP header is 20 bytes, and the UDP header is 8
bytes, so sending 8192 bytes actually should be sending 8210 bytes. HOWEVER, on
10baseT Ethernet your 8192 bytes will broken up into chunks of no larger than
1472 bytes plus the UDP header of 8 bytes and the IP header of 20 bytes and the
Ethernet frame overhead of 6 bytes. So, your total bytes sent over Ethernet will
be at least 8396.
--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
"Phil Frisbie, Jr." <ph...@hawksoft.com> wrote in message
news:3E774EA6...@hawksoft.com...
"Phil Frisbie, Jr." <ph...@hawksoft.com> wrote in message
news:3E774EA6...@hawksoft.com...
That does not make sense. You mean you are calling sendto() like this:
buflen = 8192;
len = sendto(socket, buffer, buflen, 0, &addr, addrlen);
And len is set to 8208?
Here is a simple question, are you using 8192 as the third parameter, or a sizeof()?
> "Phil Frisbie, Jr." <ph...@hawksoft.com> wrote in message
> news:3E774EA6...@hawksoft.com...
>
>>Hasani wrote:
>>
>>>when I use sendto(), I always send more than the amount I requested.
>>
> e.x.:
>
>>>If I request 8192 bytes to be sent, 8208 bytes get sent.