>As soon as I do this last call, I get a -1 in bytesReceived an
>nothing in bufferIN.
I believe you need to do the send in a loop because not all bytes are
guaranteed to be sent with the first call to NetLibSend. This works
for me.
Regards,
Steve Mann
# # #
static Err DoSend
(
UInt16 netLibRefNum, // ( in ) Netlib reference
NetSocketRef sock,
Char * data,
UInt16 * bytesSent
)
{
Int16 numBytesSent;
Int16 numBytesToSend = StrLen ( data );
Err err;
*bytesSent = 0;
do {
numBytesSent = NetLibSend (
netLibRefNum, sock, data, ( UInt16 ) numBytesToSend, 0,
NULL, 0, NETLIB_TIMEOUT, &err) ;
if ( numBytesSent > 0 )
{
numBytesToSend -= numBytesSent;
data += numBytesSent;
*bytesSent += ( UInt16 ) numBytesSent;
}
} while ( numBytesSent > 0 && numBytesToSend > 0 );
if ( numBytesSent == 0 )
//ERROR
else if ( numBytesSent < 0 )
//ERROR
return err;
}
--
-------------------------------------------
Creative Digital Publishing Inc.
1315 Palm Street, San Luis Obispo, CA 93401-3117
-------------------------------------------
805.784.9461 805.784.9462 (fax)
[EMAIL PROTECTED] http://www.cdpubs.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/