Hi Przemek, > The modifications was partially reverted so it's much easier to make: > svn diff -r 13589 telepath.prg > telepath.diff > > Functionally you changed one thing: > tp_send() uses now: > DO WHILE nTotWritten < Len( cString ) .AND. ; > ( nTimeout < 0 .OR. ( hb_milliSeconds() - nStartTime ) < nTimeout ) > ^^^ > and the previous code was using: > DO WHILE nTotWritten < Len( cString ) .AND. ; > ( nTimeout < 0 .OR. Seconds() <= nDone ) > ^^^^ > minor difference but it's bug exploited by upper level code which does not > set any timeout like hbsms.prg. > BTW hbsms.prg should be fixed because current code which does not use any > timeout and does not check number of sent bytes to resend the rest is > simply wrong and may randomly fail.
Could possibly be. I don't use hbsms at all, don't even have a serial cable around to test it, so I hope it will be "community" fixed eventually. I meant it as an initiative in the first place. > Original code which used nDone variable was more efficient then current > one using nStartTime because time difference was calculated once at startup. > The optimal code should make sth like: > nStopTime := IIF( nTimeout > 0, hb_milliSeconds() + nTimeOut * 1000 : 0 ) > [...] > WHILE .T. > [...] > IF nTimeOut <= 0 .OR. hb_milliSeconds() >= nStopTime > EXIT > ENDDO > ENDDO > > It eliminates unnecessary calculations and hb_milliSeconds() calls. The last .prg I've just sent to the list has all these undone, yet it doesn't work for some reason. I'd appreciate if you could make what you think is needed. Brgds, Viktor _______________________________________________ Harbour mailing list (attachment size limit: 40KB) [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
