Hi! I'm using NetLib to develop a client application that receives
picture(JPG) from Server.
The picture's size is 11648bytes but since the actual bytes returned form
NetLibReceive is always 5114,
I create a nuw buffer to receive the remaining bytes. But the it returns
error!
Here is a section of my code straight from my app:
----------------------------------------------------------------------------
------------------------------------------------------
UInt32 connect;
MemPtr HTTPContent;
HTTPContent = MemPtrNew(11648);
connect = NetLibReceive(libRefNum, sockfd, HTTPContent,11648, 0,NULL, 0,
timeout, &err);
if(connect == -1)
{
MemPtrFree(HTTPContent);
NetLibSocketClose(libRefNum, sockfd, timeout, &err);
NetLibClose(libRefNum, 0);
WinDrawChars("ERROR in NetLibReceive", strlen("ERROR in
NetLibReceive"),10,80);
}//end of if
else
{
char* byte;
Char s[5];
byte = StrIToA(s, connect);
WinDrawChars(byte, strlen(byte),0,100);
file_err = VFSFileWrite(fileRefP,connect,HTTPContent, NULL );
MemPtrFree(HTTPContent);
}
----------------------------------------------------------------------------
------------------------------------------------------
Like I said, the actual size of the picture I tried to receive is 11648
bytes, but everytime the received bytes "connect" returned form
NetLibReceive is 5114.
Where does the remaining bytes goes!?
Please, does anyone knows how to solve this problem!?
Angela
==========================================================
尺度驚人的精彩網站!?
http://edm-prg.epaper.com.tw/click.php?ad_code=27014
==========================================================
PChome線上購物週年慶:抽汽車、DV天天送
http://shopping.pchome.com.tw/
==========================================================
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/