ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/winhost/nettest.frm
(Generate patch)

Comparing projects/cms/source/host/winhost/nettest.frm (file contents):
Revision 1.32 by pjm2, Thu Mar 1 09:30:55 2001 UTC vs.
Revision 1.38 by tdb, Mon Mar 19 13:02:36 2001 UTC

# Line 4 | Line 4 | Object = "{33155A3D-0CE0-11D1-A6B4-444553540000}#1.0#0
4   Begin VB.Form Form1
5     BorderStyle     =   3  'Fixed Dialog
6     Caption         =   "i-scream Winhost"
7 <   ClientHeight    =   1185
7 >   ClientHeight    =   1380
8     ClientLeft      =   45
9     ClientTop       =   330
10 <   ClientWidth     =   4710
10 >   ClientWidth     =   4635
11     Icon            =   "nettest.frx":0000
12     LinkTopic       =   "Form1"
13     MaxButton       =   0   'False
14     MinButton       =   0   'False
15 <   ScaleHeight     =   1185
16 <   ScaleWidth      =   4710
15 >   ScaleHeight     =   1380
16 >   ScaleWidth      =   4635
17     ShowInTaskbar   =   0   'False
18     StartUpPosition =   2  'CenterScreen
19     Visible         =   0   'False
20     Begin VB.CommandButton Command1
21        Caption         =   "more"
22        Height          =   255
23 <      Left            =   3960
23 >      Left            =   3885
24        TabIndex        =   8
25 <      Top             =   840
25 >      Top             =   1035
26        Width           =   615
27     End
28     Begin VB.TextBox Text1
# Line 32 | Line 32 | Begin VB.Form Form1
32        MultiLine       =   -1  'True
33        ScrollBars      =   2  'Vertical
34        TabIndex        =   7
35 <      Top             =   1200
36 <      Width           =   4455
35 >      Top             =   1440
36 >      Width           =   4395
37     End
38     Begin VB.CommandButton Hide
39        Caption         =   "hide"
40        Height          =   255
41 <      Left            =   3960
41 >      Left            =   3225
42        TabIndex        =   6
43 <      Top             =   480
43 >      Top             =   1035
44        Width           =   615
45     End
46     Begin SysTray.SystemTray SystemTray
# Line 60 | Line 60 | Begin VB.Form Form1
60        Height          =   375
61        Left            =   840
62        TabIndex        =   0
63 <      Top             =   3480
63 >      Top             =   3555
64        Width           =   2895
65     End
66     Begin MSWinsockLib.Winsock TCPSock
# Line 78 | Line 78 | Begin VB.Form Form1
78        _Version        =   393216
79        Protocol        =   1
80     End
81 +   Begin VB.Image Image1
82 +      Height          =   900
83 +      Left            =   2400
84 +      Picture         =   "nettest.frx":08CA
85 +      Top             =   90
86 +      Width           =   2100
87 +   End
88     Begin VB.Label Label2
89        Alignment       =   1  'Right Justify
90        Caption         =   "Next heartbeat:"
91        Height          =   255
92        Left            =   120
93        TabIndex        =   5
94 <      Top             =   480
94 >      Top             =   645
95        Width           =   1455
96     End
97     Begin VB.Label Label1
# Line 93 | Line 100 | Begin VB.Form Form1
100        Height          =   255
101        Left            =   120
102        TabIndex        =   4
103 <      Top             =   120
103 >      Top             =   165
104        Width           =   1455
105     End
106     Begin VB.Label Label4
# Line 102 | Line 109 | Begin VB.Form Form1
109        Height          =   255
110        Left            =   1680
111        TabIndex        =   3
112 <      Top             =   480
112 >      Top             =   645
113        Width           =   615
114     End
115     Begin VB.Label Label3
# Line 111 | Line 118 | Begin VB.Form Form1
118        Height          =   255
119        Left            =   1680
120        TabIndex        =   2
121 <      Top             =   120
121 >      Top             =   165
122        Width           =   615
123     End
124     Begin VB.Label Status
# Line 120 | Line 127 | Begin VB.Form Form1
127        Height          =   255
128        Left            =   0
129        TabIndex        =   1
130 <      Top             =   840
131 <      Width           =   3855
130 >      Top             =   1035
131 >      Width           =   3180
132     End
133   End
134   Attribute VB_Name = "Form1"
# Line 154 | Line 161 | Dim TCPUpdateTime As Integer
161  
162   Dim protocolVersion As String
163   Dim connected As Boolean
164 + Dim heartBeating As Boolean
165  
166   Dim CUpTime As New CUpTime
167   Dim wksta As New CNetWksta
# Line 167 | Line 175 | Private Sub Command1_Click()
175      ' Toggle visibility of the debug output.
176  
177      If windowBig Then
178 <        Form1.Height = 1500
178 >        Form1.Height = 1755
179          windowBig = False
180      Else
181 <        Form1.Height = 4350
181 >        Form1.Height = 4380
182          windowBig = True
183      End If
184  
# Line 249 | Line 257 | Private Sub Hide_Click()
257      SystemTray.Icon = Val(Form1.Icon)
258   End Sub
259  
252 Private Sub Image1_Click()
260  
254 End Sub
255
261   Private Sub Reconfigure_Click()
262      ' establish a TCP connection to a filtermanager
263 <    connected = False
264 <    TCPSock.Close
265 <    TCPSock.Connect filterManagerHostname, filterManagerTCPPort
263 >    If Not heartBeating Then
264 >        connected = False
265 >        TCPSock.Close
266 >        TCPSock.Connect filterManagerHostname, filterManagerTCPPort
267 >    Else
268 >        Status.Caption = "Cannot reconfigure while heartbeating"
269 >    End If
270   End Sub
271  
272  
# Line 363 | Line 372 | Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo
372          End Select
373      Else
374          ' Perform a heartbeat (1.1)
375 +        heartBeating = True
376          On Error GoTo heartbeatError
377          Select Case responseNumber
378              Case 1:
# Line 379 | Line 389 | Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo
389                  Text1.Text = Text1.Text & response & vbCrLf
390                  TCPSock.SendData lastModified & vbCrLf
391              Case 4:
392 <                If Not response = "OK" Then GoTo heartbeatError
392 >                If Not response = "OK" Then
393 >                    heartBeating = False
394 >                    Reconfigure_Click
395 >                End If
396                  Text1.Text = Text1.Text & response & vbCrLf
397                  TCPSock.SendData "ENDHEARTBEAT" & vbCrLf
398              Case 5:
# Line 395 | Line 408 | Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo
408      Exit Sub
409      
410   configError:
411 <    Status.Caption = "FAILED to get configuration"
411 >    heartBeating = False
412 >    Status.Caption = "FAILED to get configuration from the server"
413      Exit Sub
414   heartbeatError:
415 +    heartBeating = False
416      Status.Caption = "Heatbeat FAILED"
417      Exit Sub
418   End Sub
# Line 466 | Line 481 | Private Sub Timer1_Timer()
481          cpu_time = CUpTime.CPUTime
482          percent_idle = CUpTime.PercentIdle
483          
469        '' Causes numbers to be too big :-/
470        'uptime = CUpTime.MilliSecs \ 1000
471        
484          '' Doesn't work after 47 days :-/
485          'uptime = GetTickCount \ 1000
486          
487 <        secondsRunning = secondsRunning + UDPUpdateTime
488 <        uptime = secondsRunning
487 >        'secondsRunning = secondsRunning + UDPUpdateTime
488 >        'uptime = secondsRunning
489          
490 +        uptime = CUpTime.MilliSecs / 1000#
491 +        
492          userCount = wksta.LoggedOnUsers
493          
494          ' build the contents of the XML packet
# Line 482 | Line 496 | Private Sub Timer1_Timer()
496                "<os>" & _
497                  "<netbios_name>" & netbiosName & "</netbios_name>" & _
498                  "<name>" & osName & "</name>" & _
499 <                "<version>" & osVersionMajor & "</version>" & _
499 >                "<version>" & osVersionMajor & "." & osVersionMinor & "</version>" & _
500                  "<release>" & osBuild & "</release>" & _
501 <                "<platform>" & osName & "</platform>" & _
488 <                "<minor_version>" & osVersionMinor & "</minor_version>" & _
489 <                "<processor>" & processorType & "</processor>" & _
501 >                "<platform>" & processorType & "</platform>" & _
502                  "<uptime>" & uptime & "</uptime>" & _
503                "</os>" & _
504                "<users><count>" & userCount & "</count></users>" & _

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines