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

Comparing experimental/host/vb_net_test/nettest.frm (file contents):
Revision 1.9 by pjm2, Fri Feb 23 11:30:25 2001 UTC vs.
Revision 1.10 by pjm2, Fri Feb 23 11:42:06 2001 UTC

# Line 1 | Line 1
1   VERSION 5.00
2   Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
3   Begin VB.Form Form1
4 <   BorderStyle     =   3  'Fixed Dialog
5 <   Caption         =   "TCP/UDP Test program"
4 >   BorderStyle     =   4  'Fixed ToolWindow
5 >   Caption         =   "i-scream Winhost"
6     ClientHeight    =   5655
7     ClientLeft      =   45
8 <   ClientTop       =   330
8 >   ClientTop       =   285
9     ClientWidth     =   5670
10     LinkTopic       =   "Form1"
11     MaxButton       =   0   'False
# Line 15 | Line 15 | Begin VB.Form Form1
15     ShowInTaskbar   =   0   'False
16     StartUpPosition =   3  'Windows Default
17     Begin VB.Timer Timer1
18 <      Left            =   3840
19 <      Top             =   120
18 >      Left            =   4200
19 >      Top             =   1200
20     End
21   Begin VB.CommandButton Command3
22      Caption         =   "TCP to Filter"
23      Height          =   375
24      Left            =   3720
25      TabIndex        =   3
26      Top             =   2520
27      Width           =   1575
28   End
21     Begin VB.TextBox Text4
22        Height          =   1575
23        Left            =   240
24        MultiLine       =   -1  'True
25        ScrollBars      =   2  'Vertical
26 <      TabIndex        =   2
26 >      TabIndex        =   1
27        Text            =   "nettest.frx":0000
28        Top             =   3000
29        Width           =   5055
30     End
31 <   Begin VB.CommandButton Command2
32 <      Caption         =   "TCP to FilterManager"
33 <      Height          =   375
34 <      Left            =   3360
35 <      TabIndex        =   1
36 <      Top             =   2040
37 <      Width           =   1935
31 >   Begin VB.CommandButton Reconfigure
32 >      Caption         =   "Reconfigure with FilterManager"
33 >      Height          =   495
34 >      Left            =   120
35 >      TabIndex        =   0
36 >      Top             =   120
37 >      Width           =   2895
38     End
39     Begin MSWinsockLib.Winsock TCPSock
40 <      Left            =   4920
41 <      Top             =   120
40 >      Left            =   5160
41 >      Top             =   1200
42        _ExtentX        =   741
43        _ExtentY        =   741
44        _Version        =   393216
45     End
54   Begin VB.CommandButton Command1
55      Caption         =   "Send UDP"
56      Height          =   375
57      Left            =   4320
58      TabIndex        =   0
59      Top             =   1560
60      Width           =   975
61   End
46     Begin MSWinsockLib.Winsock UDPSock
47 <      Left            =   4320
48 <      Top             =   120
47 >      Left            =   4680
48 >      Top             =   1200
49        _ExtentX        =   741
50        _ExtentY        =   741
51        _Version        =   393216
# Line 71 | Line 55 | Begin VB.Form Form1
55        Alignment       =   1  'Right Justify
56        Caption         =   "Next heartbeat:"
57        Height          =   255
58 <      Left            =   120
59 <      TabIndex        =   8
58 >      Left            =   3360
59 >      TabIndex        =   6
60        Top             =   480
61        Width           =   1455
62     End
# Line 80 | Line 64 | Begin VB.Form Form1
64        Alignment       =   1  'Right Justify
65        Caption         =   "Next UDP packet:"
66        Height          =   255
67 <      Left            =   120
68 <      TabIndex        =   7
67 >      Left            =   3360
68 >      TabIndex        =   5
69        Top             =   120
70        Width           =   1455
71     End
72     Begin VB.Label Label4
73 +      BorderStyle     =   1  'Fixed Single
74        Caption         =   "0"
75        Height          =   255
76 <      Left            =   1680
77 <      TabIndex        =   6
76 >      Left            =   4920
77 >      TabIndex        =   4
78        Top             =   480
79        Width           =   615
80     End
81     Begin VB.Label Label3
82 +      BorderStyle     =   1  'Fixed Single
83        Caption         =   "0"
84        Height          =   255
85 <      Left            =   1680
86 <      TabIndex        =   5
85 >      Left            =   4920
86 >      TabIndex        =   3
87        Top             =   120
88        Width           =   615
89     End
# Line 105 | Line 91 | Begin VB.Form Form1
91        Caption         =   "Status:"
92        Height          =   255
93        Left            =   120
94 <      TabIndex        =   4
95 <      Top             =   5280
94 >      TabIndex        =   2
95 >      Top             =   840
96        Width           =   5415
97     End
98   End
# Line 148 | Line 134 | Private Sub Command1_Click()
134  
135   End Sub
136  
151 Private Sub Command2_Click()
152    
153    ' establish a TCP connection to a filtermanager
154    TCPSock.Close
155    TCPSock.Connect filterManagerHostname, filterManagerTCPPort
137  
157 End Sub
158
138   Private Sub Command3_Click()
139      ' establish a TCP connection to a filter
140      TCPSock.Close
# Line 164 | Line 143 | End Sub
143  
144   Private Sub Form_Load()
145      protocolVersion = "1.1"
146 +      
147 +    Status.Caption = "Loading"
148 +    Form1.Caption = "i-scream Winhost " & protocolVersion
149      
168    Status.Caption = "i-scream Winhost " & protocolVersion
169    
150      ''''TEMP
151      filterManagerHostname = "killigrew.ukc.ac.uk"
152      filterManagerTCPPort = 4567
153 +    Reconfigure_Click
154      Exit Sub
155      ''' ENDTEMP
156      
# Line 181 | Line 162 | Private Sub Form_Load()
162      length = GetPrivateProfileString("i-scream Winhost", "FilterManagerPort", "<no value>", buf, Len(buf), App.Path & "winhost.ini")
163      filterManagerTCPPort = Left$(buf, length)
164      
165 <    Status.Caption = "i-scream Winhost " & protocolVersion & " connecting to Filter Manager"
165 >    Status.Caption = "Connecting to Filter Manager"
166      
167      Exit Sub
168      
# Line 191 | Line 172 | iniError:
172      
173   End Sub
174  
175 + Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
176 +    x = MsgBox("Are you sure you want to shut down the Winhost?", vbYesNo, "i-scream Winhost")
177 +    If x = 7 Then
178 +        Cancel = True
179 +    End If
180 +
181 + End Sub
182 +
183 + Private Sub Reconfigure_Click()
184 +    ' establish a TCP connection to a filtermanager
185 +    connected = False
186 +    TCPSock.Close
187 +    TCPSock.Connect filterManagerHostname, filterManagerTCPPort
188 + End Sub
189 +
190   Private Sub TCPSock_Connect()
191      
192      responseNumber = 0
# Line 264 | Line 260 | Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo
260                  responseNumber = 0
261                  TCPSock.Close
262                  Text4.Text = Text4.Text & vbCrLf & "  <closed>"
263 <                Status.Caption = "i-scream Winhost " & protocolVersion & " - got config okay"
263 >                Status.Caption = "Configuration successful"
264                  Label3.Caption = UDPUpdateTime
265                  Label4.Caption = TCPUpdateTime
266                  Timer1.Interval = 1000
# Line 288 | Line 284 | Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo
284              Case 5:
285                  If Not response = "OK" Then GoTo heartbeatError
286                  TCPSock.Close
287 <                Status.Caption = "i-scream Winhost " & protocolVersion & " - heartbeat sent okay."
287 >                Status.Caption = "Heartbeat sent successfully."
288          End Select
289      
290      End If
# Line 297 | Line 293 | Private Sub TCPSock_DataArrival(ByVal bytesTotal As Lo
293      Exit Sub
294      
295   configError:
296 <    Status.Caption = "i-scream Winhost " & protocolVersion & " - FAILED to get configuration " & Err.Description
296 >    Status.Caption = "FAILED to get configuration"
297      Exit Sub
298   heartbeatError:
299 <    Status.Caption = "i-scream Winhost " & protocolVersion & " - Heatbeat FAILED " & Err.Description
299 >    Status.Caption = "Heatbeat FAILED"
300      Exit Sub
301   End Sub
302  
307 Private Sub TCPTimer_Timer()
308    
309    ' establish a TCP connection to a filter
310    TCPSock.Close
311    TCPSock.Connect filterHostname, filterTCPPort
312
313 End Sub
314
315 Private Sub UDPTimer_Timer()
316    
317    ' build the contents of the XML packet.
318    xml = "<packet></packet>"
319
320    ' Use the first winsock control to send a UDP packet.
321    UDPSock.RemoteHost = filterHostname
322    UDPSock.RemotePort = filterUDPPort
323    UDPSock.SendData xml
324    Status.Caption = "i-scream Winhost " & protocolVersion & " - UDP packet sent."
325
326 End Sub
327
303   Private Sub Timer1_Timer()
304  
305      Label3.Caption = Label3.Caption - 1
306      Label4.Caption = Label4.Caption - 1
307      
308 <    Status.Caption = "i-scream Winhost " & protocolVersion
308 >    Status.Caption = ""
309      
310      If Label3.Caption < 1 Then
311          ' build the contents of the XML packet.
# Line 340 | Line 315 | Private Sub Timer1_Timer()
315          UDPSock.RemoteHost = filterHostname
316          UDPSock.RemotePort = filterUDPPort
317          UDPSock.SendData xml
318 <        Status.Caption = "i-scream Winhost " & protocolVersion & " - UDP packet sent."
318 >        Status.Caption = "UDP packet sent"
319          Label3.Caption = UDPUpdateTime
320      End If
321      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines