I don't see a call to INetLibHTTPReqCreate or INetLibHTTReqSend in the code
below. My guess is that you can't read anything from the socket because you
haven't requested any data.

Try adding something like this between the call to INetLibURLOpen and
INetLibSockRead:

// BEGIN CODE
result = INetLibSockHTTPReqCreate(
  INetRef,
  sockHandle,
  (Byte*)"GET",         // request method
  (Byte*)"/index.html", // resource
  NULL);

result = INetLibSockHTTPReqSend(
  INetRef,
  sockHandle,
  NULL, // no extra data
  0,
  -1);  // infinite timeout
// END CODE

Also, regarding error codes, are you using the emulator? I've found that my
INetLib programs are *much* happier if I shut the emulator down between
program runs. This might just be my code tho :).

  - Jaba Adams

-----Original Message-----
From: Scott Lopez [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 01, 1999 9:38 AM
To: palm
Subject: wireless problems


I've seen several people ask this question on the newsgroups without an
answer, perhaps you could help.

I have the following code:

  Err err = FtrGet(inetLibFtrCreator,inetFtrNumVersion, &_value);
  Handle inetH, sockH;
  Word status;
  Err  error;
  Boolean inputReady, outputReady;
  Byte buffer[255];
  DWord bytesIn;

  if(err == 0)
  {
   err = SysLibFind("INet.lib",&libRefNum);

   Word  index;
   err = INetLibConfigIndexFromName(libRefNum,(INetConfigNameType
*)inetCfgNameCTPWireless , &index);
   err = INetLibOpen(libRefNum,index,0,NULL,0,&inetH);

   err = INetLibCheckAntennaState(libRefNum);

   Byte URL[255];
   StrCopy((CharPtr)&URL,"http://www.dive-site.com/index.html");

   err = INetLibURLOpen(libRefNum,inetH,URL,NULL,&sockH,-1,0);

   err = INetLibSockRead(libRefNum,sockH,&buffer,50,&bytesIn,-1);

   err = INetLibSockClose(libRefNum,sockH);

   err = INetLibClose(libRefNum,inetH);

  }

}

All indications are that up until the read everything is working great.
When I run a status check before the read, an 11 is returned indicating
network unreachable.  When I remove the http:// from the URL, the open
command generates an error.  My problem is that it's staying in the read
state forever waiting for the document, the document is received using
the PQA that I wrote from the same server so I know that the Palm has access
to it.  Ideas?


Reply via email to