> bytesSent = NetLibSend(NetLibNum, SocketRef, buffer, StrLen(buffer),
>netIOFlagOutOfBand,
> (NetSocketAddrType *) &sockAddrP, sizeof(sockAddrP), timeout, &err);
DISCLAIMER: I've just started working with this stuff, so I may be
totally full of balony.
It's my understanding that NetLibSend may not send everything at
once, so you have to stick it in a loop. Here's code that works for
me:
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/