The simulator stays idle for a long time when running a simple net app. I tried 
using NetLibSelect, I am using redirection TCP/IP and have tried other things 
but nothing.

err = SysLibFind("Net.lib", &NRef);
err = NetLibOpen(NRef, &ifErrs);
sock = NetLibSocketOpen(NRef, netSocketAddrINET, netSocketTypeStream, 0, 
AppNetTimeout, &ifErrs);
nhinfo = NetLibGetHostByName(NRef, "www.thsounds.com", &nh, AppNetTimeout, 
&ifErrs);
MemSet(&sain, sizeof(sain), 0); sain.addr = nh.address[0];
sain.family = netSocketAddrINET; sain.port = NetHToNS(80);
err = NetLibSocketConnect(NRef, sock, (NetSocketAddrType *) & sain, 
sizeof(sain), AppNetTimeout, &ifErrs);
...
NetLibSend(NRef, sock, "GET /index.html HTTP/1.1\nHost: www.thsounds.com", 
sizel, 0, 0, 0, AppNetTimeout, &ifErrs);
...
NetLibSend(NRef, sock, "\n\n", 2, 0, 0, 0, AppNetTimeout, &ifErrs);

netFDZero(&rfds);
netFDZero(&wfds);
netFDSet(sysFileDescStdIn, &rfds);
netFDSet(sock, &rfds);
//netFDSet(sock, &wfds);
NetLibSelect(NRef, netFDSetSize, &rfds, &wfds, NULL, 50, &ifErrs);
i = NetLibReceive(NRef, sock, dest2, 50, 0, NULL, NULL, AppNetTimeout, &ifErrs);

can anyone see a problem here?

Thanks!

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

Reply via email to