The problem is one that only happens once every 15-20 times.  What I am 
doing is downloading a HTTP page, and putting it in a DB.  Sometimes the 
returned value of the call never falls below 1.  There is only about 415 
bytes to recevice from the page, and ive watched in run in a loop for 10 
mins sometimes.  Below is the section of code that is causing the problems.

bytesRcvd = NetLibDmReceive(libRefNum,MainSocket,p,totSize,20000, 0, 
0,0,netTimeout, &error);
WinDrawChars("1",1,25,25);
bufPStart = bufP;
totSize = bytesRcvd;
while(bytesRcvd > 0)
{
WinDrawChars("2",1,25,25);
bufP = bufP+totSize;
bytesRcvd = NetLibDmReceive(libRefNum,MainSocket,p,totSize,20000, 0, 
0,0,netTimeout, &error);
totSize = totSize+bytesRcvd;
WinDrawChars("3",1,25,25);
}
WinDrawChars("4",1,25,25);
MemPtrUnlock(p);
DmReleaseResource(h);
DmCloseDatabase(VdbHandle);
WinEraseChars("Receiving server response",StrLen("Receiving server 
response"),25,89);

Sometimes it will sit there and switch between the WinDrawChars("2") and 
("3").  Its changing so fast you can almost not make out the 3, but it 
flickers, so I can see it is drawing both, this means that it is not just 
stuck inside the receive call, but rather trying to recevice data thousands 
of times.  Like I said, this only happens once in a while, most of the time 
it recevices the page fine.  It will execute the while loop 2 or 3 times on 
avg.  I cant figure out why it will sometimes not set bytesRcvd to 0.  Most 
times, it does set it to 0 once all the data has been recevice, and it 
breaks from the loop and continues fine.  Anyone ever see this problem, or 
know what might be causing it?
-- 


Scott Erickson
Software Development Team, FB-4, Inc.
[EMAIL PROTECTED] 



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

Reply via email to