Argh! After several years away from Palm OS C programming, I set out to write
an app for a Symbol Palm Device with integrated BarCode scanner and Wireless
Networking.
What a nightmare.
After unsuccessfully trying to find an existing HTTP code snippet, I tried
writing my own simple example (listed below). However, I keep getting a "DNS
Refused" error on the Palm. (netErrDNSRefused)
An abbreviated version of the code is below.
Palm lists a INetLow40 file on their knowledgebase as a successor to the 3.5
ROM version of INetLow, but INetLow40 is no longer available anywhere for
download.
So I started writing my own, and once again I get this DNS refused error on the
emulator. I am using a 4.1X rom on the emulator
All I want to be able to do is to send a simple query string to my php server
(www.myserver.com/myphpfile.php?arg1=1&arg2=2) but it has proved to be very
frustrating to accomplish.
UInt32 myFeatureValue;
UInt16 myLibraryReferenceNumber;
INetConfigNameType myInternetConfigurationName;
UInt16 myInternetConfigRefNumber;
MemHandle myInternetHandle;
MemHandle mySocketHandle;
UInt32 myRequestedByteCount;
UInt32 myActualByteCount;
myRequestedByteCount=500;
myErrorCode = FtrGet(inetLibFtrCreator, inetFtrNumVersion,
&myFeatureValue);
myErrorCode = SysLibFind("INet.lib", &myLibraryReferenceNumber);
StrCopy(myInternetConfigurationName.name, inetCfgNameCTPDefault);
myErrorCode = INetLibConfigIndexFromName(myLibraryReferenceNumber,
&myInternetConfigurationName, &myInternetConfigRefNumber);
myErrorCode = INetLibOpen(myLibraryReferenceNumber,
myInternetConfigRefNumber, 0, NULL, 0, &myInternetHandle);
myErrorCode =
INetLibURLOpen(myLibraryReferenceNumber,myInternetHandle,(UInt8*)"http://www.yahoo.com/",NULL,&mySocketHandle,evtWaitForever,0);
myErrorCode =
INetLibSockRead(myLibraryReferenceNumber,mySocketHandle,&myBuffer,myRequestedByteCount,&myActualByteCount,evtWaitForever);
myErrorCode = INetLibSockClose(myLibraryReferenceNumber,mySocketHandle);
myErrorCode = INetLibClose(myLibraryReferenceNumber,myInternetHandle);
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/