First off, you allocate 500 bytes and then tell NetLibReceive() you have
room for 1000 bytes. Second, you are passing the address of the pointer to
your buffer, not the address of the buffer. Try:

#define kBufSize 1000
void *str = MemPtrNew(kBufSize);

Int16 result = NetLibReceive(AppNetRefnum,socket,str,kBufSize,
   0,(NetSocketAddrType*)&destAddr,&size,-1,&error);


-----Original Message-----
From: versha khar
To: Palm Developer Forum
Sent: 3/16/2005 1:55 AM
Subject: error - buffer isn't large enough for the purpose

hi all ,
i am running a network communication program , my NetLibReceive gives an
error , buffer isn't large enough for data.
but the data i get from the server is very small .

str  = MemPtrNew( sizeof( char ) * 500 );

result = NetLibReceive(AppNetRefnum , socket ,&str , 1000 , 0
,(NetSocketAddrType *)&destAddr , &size, -1 , &error );

i get 0 bytes received in result while debugging.

kindly suggest!

thanks
versha

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

Reply via email to