Hi Matt!

> This is an excerpt from Palm OS Companion2.pdf, p16, (sdk 4.0).
> ...
> while (!err && sizeSent < size) {
>    sizeSent += ExgSend(&exgSocket,bmpP,size,&err);
> ...
> Shouldn't the call to ExgSend be
>    sizeSent += ExgSend(&exgSocket, bmpP + sizeSent, size - sizeSent, &err);

The docs for ExgSend say:
> This function blocks the application until all the data is sent.

The docs for ExgLibSend are similar:
> This function blocks until all bytes to be sent are actually sent, or
> until an error occurs (such as device full).

So the code you quoted in the Companion works correctly, but the loop isn't needed 
(and is therefore confusing). The loop will never execute more than once, so the fact 
that it doesn't advance correctly doesn't matter. The documentation should be changed 
to remove the loop. The same goes for the sample apps.

Note that when the docs for ExgSend say:
   Call this function one or more times to send all the data, following a
   successful call to ExgPut.
they're referring to multiple calls with different buffers, or with the same buffer 
but different data in the buffer. There is no need to call ExgSend repeatedly if you 
have a single contiguous chunk of data that's ready to send.

Thanks for bringing this to our attention.
-
Danny

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to