General information
Category:
COM/DCOM and OLE Automation
Title:
Speed fox test code
this code illustrates a delay problem, the "server" responds in about one second, the client takes about 5 seconds ! All suggestions welcome
the test environment was to access the client from a different computer.
SERVER
CREATE TABLE servtab (t1 c(8),t2 c(8), t3 c(8), new l)
use servtab shared
DO WHILE reccount() < 10
=sleeper(1) && sleep 1 second
GO TOP
LOCATE FOR new
IF FOUND()
REPLACE t2 WITH TIME() , new WITH .F.
FLUSH
ENDIF
ENDDO
brow
use
PROCEDURE sleeper
PARAMETER secs
DECLARE Sleep IN Win32API INTEGER nMilliseconds
nmilliseconds = secs * 1000
=sleep(nmilliseconds)
CLIENT
USE servtab shared
DO WHILE RECCOUNT() < 10
APPEND BLANK
REPLACE new WITH .T., t1 WITH TIME()
trecno=RECNO()
FLUSH
go top
inloop=1
DO WHILE inloop < 120 && exit after 2 minutes
=sleeper(1) && sleep 1 second
go trecno
IF .not. new && if server processed record
REPLACE t3 WITH TIME()
flush
go top
inloop=121
endif
ENDDO
ENDDO
use
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only