| 14 |
|
ScaleWidth = 5670 |
| 15 |
|
ShowInTaskbar = 0 'False |
| 16 |
|
StartUpPosition = 3 'Windows Default |
| 17 |
+ |
Begin VB.Timer TCPTimer |
| 18 |
+ |
Left = 3360 |
| 19 |
+ |
Top = 120 |
| 20 |
+ |
End |
| 21 |
+ |
Begin VB.Timer UDPTimer |
| 22 |
+ |
Left = 3840 |
| 23 |
+ |
Top = 120 |
| 24 |
+ |
End |
| 25 |
|
Begin VB.CommandButton Command3 |
| 26 |
|
Caption = "TCP to Filter" |
| 27 |
|
Height = 375 |
| 28 |
|
Left = 3720 |
| 29 |
< |
TabIndex = 5 |
| 29 |
> |
TabIndex = 3 |
| 30 |
|
Top = 2520 |
| 31 |
|
Width = 1575 |
| 32 |
|
End |
| 33 |
|
Begin VB.TextBox Text4 |
| 34 |
< |
Height = 2535 |
| 34 |
> |
Height = 1575 |
| 35 |
|
Left = 240 |
| 36 |
|
MultiLine = -1 'True |
| 37 |
|
ScrollBars = 2 'Vertical |
| 38 |
< |
TabIndex = 4 |
| 38 |
> |
TabIndex = 2 |
| 39 |
|
Text = "nettest.frx":0000 |
| 40 |
|
Top = 3000 |
| 41 |
|
Width = 5055 |
| 44 |
|
Caption = "TCP to FilterManager" |
| 45 |
|
Height = 375 |
| 46 |
|
Left = 3360 |
| 47 |
< |
TabIndex = 3 |
| 47 |
> |
TabIndex = 1 |
| 48 |
|
Top = 2040 |
| 49 |
|
Width = 1935 |
| 50 |
|
End |
| 59 |
|
Caption = "Send UDP" |
| 60 |
|
Height = 375 |
| 61 |
|
Left = 4320 |
| 62 |
< |
TabIndex = 2 |
| 62 |
> |
TabIndex = 0 |
| 63 |
|
Top = 1560 |
| 64 |
|
Width = 975 |
| 65 |
|
End |
| 58 |
– |
Begin VB.TextBox Text1 |
| 59 |
– |
Height = 855 |
| 60 |
– |
Left = 360 |
| 61 |
– |
TabIndex = 0 |
| 62 |
– |
Text = "<packet></packet>" |
| 63 |
– |
Top = 600 |
| 64 |
– |
Width = 4935 |
| 65 |
– |
End |
| 66 |
|
Begin MSWinsockLib.Winsock UDPSock |
| 67 |
|
Left = 4320 |
| 68 |
|
Top = 120 |
| 71 |
|
_Version = 393216 |
| 72 |
|
Protocol = 1 |
| 73 |
|
End |
| 74 |
+ |
Begin VB.Label Label2 |
| 75 |
+ |
Caption = "Label2" |
| 76 |
+ |
Height = 255 |
| 77 |
+ |
Left = 120 |
| 78 |
+ |
TabIndex = 6 |
| 79 |
+ |
Top = 600 |
| 80 |
+ |
Width = 3375 |
| 81 |
+ |
End |
| 82 |
|
Begin VB.Label Label1 |
| 83 |
< |
Caption = "Packet contents" |
| 83 |
> |
Caption = "Label1" |
| 84 |
|
Height = 255 |
| 85 |
< |
Left = 360 |
| 86 |
< |
TabIndex = 1 |
| 87 |
< |
Top = 360 |
| 88 |
< |
Width = 2895 |
| 85 |
> |
Left = 120 |
| 86 |
> |
TabIndex = 5 |
| 87 |
> |
Top = 240 |
| 88 |
> |
Width = 3375 |
| 89 |
|
End |
| 90 |
+ |
Begin VB.Label Status |
| 91 |
+ |
Caption = "Status:" |
| 92 |
+ |
Height = 255 |
| 93 |
+ |
Left = 120 |
| 94 |
+ |
TabIndex = 4 |
| 95 |
+ |
Top = 5280 |
| 96 |
+ |
Width = 5415 |
| 97 |
+ |
End |
| 98 |
|
End |
| 99 |
|
Attribute VB_Name = "Form1" |
| 100 |
|
Attribute VB_GlobalNameSpace = False |
| 113 |
|
Dim fileList As String |
| 114 |
|
Dim lastModified As String |
| 115 |
|
|
| 116 |
+ |
Dim UDPUpdateTime As Integer |
| 117 |
+ |
Dim TCPUpdateTime As Integer |
| 118 |
+ |
|
| 119 |
|
Dim protocolVersion As String |
| 120 |
|
Dim connected As Boolean |
| 121 |
|
Dim responseNumber As Integer |
| 130 |
|
UDPSock.RemoteHost = filterHostname |
| 131 |
|
UDPSock.RemotePort = filterUDPPort |
| 132 |
|
UDPSock.SendData xml |
| 133 |
+ |
Status.Caption = "i-scream Winhost " & protocolVersion & " - UDP packet sent." |
| 134 |
|
|
| 135 |
|
End Sub |
| 136 |
|
|
| 151 |
|
Private Sub Form_Load() |
| 152 |
|
protocolVersion = "1.1" |
| 153 |
|
|
| 154 |
+ |
Status.Caption = "i-scream Winhost " & protocolVersion |
| 155 |
+ |
|
| 156 |
|
''''TEMP |
| 157 |
|
filterManagerHostname = "killigrew.ukc.ac.uk" |
| 158 |
|
filterManagerTCPPort = 4567 |
| 167 |
|
length = GetPrivateProfileString("i-scream Winhost", "FilterManagerPort", "<no value>", buf, Len(buf), App.Path & "winhost.ini") |
| 168 |
|
filterManagerTCPPort = Left$(buf, length) |
| 169 |
|
|
| 170 |
+ |
Status.Caption = "i-scream Winhost " & protocolVersion & " connecting to Filter Manager" |
| 171 |
+ |
|
| 172 |
|
Exit Sub |
| 173 |
|
|
| 174 |
|
iniError: |
| 178 |
|
End Sub |
| 179 |
|
|
| 180 |
|
Private Sub TCPSock_Connect() |
| 181 |
< |
|
| 182 |
< |
responseNumber = 0 |
| 181 |
> |
|
| 182 |
> |
responseNumber = 0 |
| 183 |
|
|
| 184 |
|
' Send something as soon as we connect to the server. |
| 185 |
|
If connected = False Then |
| 221 |
|
TCPSock.SendData "UDPUpdateTime" & vbCrLf |
| 222 |
|
Case 4: |
| 223 |
|
If response = "ERROR" Then GoTo configError |
| 224 |
+ |
UDPUpdateTime = response |
| 225 |
|
TCPSock.SendData "TCPUpdateTime" & vbCrLf |
| 226 |
|
Case 5: |
| 227 |
|
If response = "ERROR" Then GoTo configError |
| 228 |
+ |
TCPUpdateTime = response |
| 229 |
|
TCPSock.SendData "ENDCONFIG" & vbCrLf |
| 230 |
|
Case 6: |
| 231 |
|
If Not response = "OK" Then GoTo configError |
| 250 |
|
responseNumber = 0 |
| 251 |
|
TCPSock.Close |
| 252 |
|
Text4.Text = Text4.Text & vbCrLf & " <closed>" |
| 253 |
< |
x = MsgBox("got config okay") |
| 253 |
> |
Label1.Caption = "TCP hearbeat interval: " & UDPUpdateTime |
| 254 |
> |
Label2.Caption = "UDP packet interval: " & TCPUpdateTime |
| 255 |
> |
Status.Caption = "i-scream Winhost " & protocolVersion & " - got config okay" |
| 256 |
|
End Select |
| 257 |
|
Else |
| 258 |
|
' Perform a heartbeat (1.1) |
| 273 |
|
Case 5: |
| 274 |
|
If Not response = "OK" Then GoTo heartbeatError |
| 275 |
|
TCPSock.Close |
| 276 |
< |
x = MsgBox("heartbeat sent okay.") |
| 276 |
> |
Status.Caption = "i-scream Winhost " & protocolVersion & " - heartbeat sent okay." |
| 277 |
|
End Select |
| 278 |
|
|
| 279 |
|
End If |
| 282 |
|
Exit Sub |
| 283 |
|
|
| 284 |
|
configError: |
| 285 |
< |
x = MsgBox("error doing configuration") |
| 285 |
> |
Status.Caption = "i-scream Winhost " & protocolVersion & " - FAILED to get configuration" |
| 286 |
|
heartbeatError: |
| 287 |
< |
x = MsgBox("error doing configuration") |
| 287 |
> |
Status.Caption = "i-scream Winhost " & protocolVersion & " - Heatbeat FAILED" |
| 288 |
|
End Sub |
| 289 |
|
|