--- projects/cms/source/host/winhost/nettest.frm 2001/03/01 09:30:55 1.32 +++ projects/cms/source/host/winhost/nettest.frm 2001/03/19 10:11:15 1.36 @@ -154,6 +154,7 @@ Dim TCPUpdateTime As Integer Dim protocolVersion As String Dim connected As Boolean +Dim heartBeating As Boolean Dim CUpTime As New CUpTime Dim wksta As New CNetWksta @@ -249,15 +250,16 @@ Private Sub Hide_Click() SystemTray.Icon = Val(Form1.Icon) End Sub -Private Sub Image1_Click() -End Sub - Private Sub Reconfigure_Click() ' establish a TCP connection to a filtermanager - connected = False - TCPSock.Close - TCPSock.Connect filterManagerHostname, filterManagerTCPPort + If Not heartBeating Then + connected = False + TCPSock.Close + TCPSock.Connect filterManagerHostname, filterManagerTCPPort + Else + Status.Caption = "Cannot reconfigure while heartbeating" + End If End Sub @@ -363,6 +365,7 @@ Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo End Select Else ' Perform a heartbeat (1.1) + heartBeating = True On Error GoTo heartbeatError Select Case responseNumber Case 1: @@ -379,7 +382,10 @@ Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo Text1.Text = Text1.Text & response & vbCrLf TCPSock.SendData lastModified & vbCrLf Case 4: - If Not response = "OK" Then GoTo heartbeatError + If Not response = "OK" Then + heartBeating = False + Reconfigure_Click + End If Text1.Text = Text1.Text & response & vbCrLf TCPSock.SendData "ENDHEARTBEAT" & vbCrLf Case 5: @@ -395,9 +401,11 @@ Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo Exit Sub configError: - Status.Caption = "FAILED to get configuration" + heartBeating = False + Status.Caption = "FAILED to get configuration from the server" Exit Sub heartbeatError: + heartBeating = False Status.Caption = "Heatbeat FAILED" Exit Sub End Sub @@ -466,15 +474,14 @@ Private Sub Timer1_Timer() cpu_time = CUpTime.CPUTime percent_idle = CUpTime.PercentIdle - '' Causes numbers to be too big :-/ - 'uptime = CUpTime.MilliSecs \ 1000 - '' Doesn't work after 47 days :-/ 'uptime = GetTickCount \ 1000 - secondsRunning = secondsRunning + UDPUpdateTime - uptime = secondsRunning + 'secondsRunning = secondsRunning + UDPUpdateTime + 'uptime = secondsRunning + uptime = CUpTime.MilliSecs / 1000# + userCount = wksta.LoggedOnUsers ' build the contents of the XML packet @@ -482,11 +489,9 @@ Private Sub Timer1_Timer() "" & _ "" & netbiosName & "" & _ "" & osName & "" & _ - "" & osVersionMajor & "" & _ + "" & osVersionMajor & "." & osVersionMinor & "" & _ "" & osBuild & "" & _ - "" & osName & "" & _ - "" & osVersionMinor & "" & _ - "" & processorType & "" & _ + "" & processorType & "" & _ "" & uptime & "" & _ "" & _ "" & userCount & "" & _