I've been working with the "InetLow" Internet Library sample code, found at:
     http://oasis.palm.com/dev/kb/samples/1709.cfm

This example was written to retrieve "text" data from a host.

I'm trying to retrieve a 5Kb Palm bitmap and it will only retrieve about 
300 bytes. I'm thinking I need to tell the socket that I am reading a 
binary stream.  I tried altering the following code...

<snip1>
     INetLowInfoType inetInfoBlock;
     UInt16          inetFlags      = 0; // Won't use this, but you could set
                                         // to use the cache, etc.
     UInt16          sockFlags      = 0;
     UInt16          sockFlagsL     = sizeof(UInt16);
     Err             error          = 0;

     error = INetLibSockSettingSet(inetInfoBlock.inetRefNum,
                    inetInfoBlock.inetSockH,
                    inetSockSettingFlags,
                    (MemPtr)&inetFlags,
                    sizeof(inetFlags));
</snip1>


like this

<snip2>
     INetLowInfoType inetInfoBlock;
     UInt16          inetFlags      = 0;
     UInt16          sockFlags      = 0;
     UInt16          sockFlagsL     = sizeof(UInt16);
     Err             error          = 0;

     inetFlags = inetContentTypeImagePalmOS; // Palm OS bitmap
     error = INetLibSockSettingSet(inetInfoBlock.inetRefNum,
                    inetInfoBlock.inetSockH,
                    inetSockSettingContentTypeID,   //  set the content type.
                    (MemPtr)&inetFlags,             //  to a Palm OS bitmap
                    sizeof(inetFlags));
</snip2>


The code in snip2 returns an error value of 5148. The API states this call 
should return one of three values:

     0 - no error
     inetErrSettingNotImplemented    - "Invalid setting specified" (S/B 1403)
     inetErrSettingSizeInvalid       - "bufLen is the incorrect size for the
                                       setting"  (S/B 1402)

So the 5148 return value is way out in the weeds. Does anyone have any idea 
how to set up the socket for a Palm bitmap (binary stream?)

Do I need to alter further code? Any comments are welcome.


TIA,

~jeff 


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

Reply via email to