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.12 by pjm2, Fri Feb 23 12:01:14 2001 UTC vs.
Revision 1.14 by pjm2, Fri Feb 23 13:27:09 2001 UTC

# Line 124 | Line 124 | Private Declare Function GetPrivateProfileInt Lib "ker
124   Dim filterManagerHostname As String
125   Dim filterManagerTCPPort As Integer
126  
127 + Dim seqNo As Long
128 + Dim machineName As String
129 +
130   Dim filterHostname As String
131   Dim filterTCPPort As Integer
132   Dim filterUDPPort As Integer
# Line 137 | Line 140 | Dim protocolVersion As String
140   Dim connected As Boolean
141   Dim responseNumber As Integer
142  
140
141 Private Sub Command1_Click()
142
143    ' build the contents of the XML packet.
144    xml = "<packet></packet>"
145
146    ' Use the first winsock control to send a UDP packet.
147    UDPSock.RemoteHost = filterHostname
148    UDPSock.RemotePort = filterUDPPort
149    UDPSock.SendData xml
150    Status.Caption = "i-scream Winhost " & protocolVersion & " - UDP packet sent."
151
152 End Sub
153
154
155 Private Sub Command3_Click()
156    ' establish a TCP connection to a filter
157    TCPSock.Close
158    TCPSock.Connect filterHostname, filterTCPPort
159 End Sub
160
143   Private Sub Form_Load()
144 +    
145      protocolVersion = "1.1"
146 <      
146 >    
147      Status.Caption = "Loading"
148      Form1.Caption = "i-scream Winhost " & protocolVersion
149      
150      ''''TEMP
151      filterManagerHostname = "killigrew.ukc.ac.uk"
152      filterManagerTCPPort = 4567
153 <    Reconfigure_Click
171 <    Exit Sub
172 <    ''' ENDTEMP
153 >    ''''' END TEMP
154      
155 +    GoTo skip
156      On Error GoTo iniError
157      Dim buf As String * 256
158      Dim length As Long
# Line 178 | Line 160 | Private Sub Form_Load()
160      filterManagerHostname = Left$(buf, length)
161      length = GetPrivateProfileString("i-scream Winhost", "FilterManagerPort", "<no value>", buf, Len(buf), App.Path & "winhost.ini")
162      filterManagerTCPPort = Left$(buf, length)
163 <    
163 > skip:
164 >
165      Status.Caption = "Connecting to Filter Manager"
166 +    Reconfigure_Click
167      
168      Exit Sub
169      
# Line 344 | Line 328 | Private Sub Timer1_Timer()
328      
329      If Label3.Caption < 1 Then
330          ' build the contents of the XML packet.
331 <        xml = "<packet></packet>"
331 >        localIP = TCPSock.localIP
332 >        machineName = TCPSock.LocalHostName
333 >        seqNo = seqNo + 1
334 >        packetDate = Date2Num()
335 >        xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & localIP & """>" & _
336 >              "" & _
337 >              "" & _
338 >              "" & _
339 >              "" & _
340 >              "" & _
341 >              "" & _
342 >              "" & _
343 >              "" & _
344 >              "" & _
345 >              "" & _
346 >              "" & _
347 >              "" & _
348 >              "" & _
349 >              "" & _
350 >              ""
351 >        Text4.Text = Text4.Text + xml
352  
353          ' Use the first winsock control to send a UDP packet.
354          UDPSock.RemoteHost = filterHostname
# Line 362 | Line 366 | Private Sub Timer1_Timer()
366      End If
367  
368   End Sub
369 +
370 + Function Date2Num() As Long
371 +    Dim x As Long
372 +    x = DateDiff("s", "1-1-1970", Now)
373 +    Date2Num = x
374 + End Function

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines