--- projects/cms/source/host/winhost/nettest.frm 2001/02/23 12:01:14 1.12 +++ projects/cms/source/host/winhost/nettest.frm 2001/02/23 13:23:53 1.13 @@ -124,6 +124,9 @@ Private Declare Function GetPrivateProfileInt Lib "ker Dim filterManagerHostname As String Dim filterManagerTCPPort As Integer +Dim seqNo As Long +Dim machineName As String + Dim filterHostname As String Dim filterTCPPort As Integer Dim filterUDPPort As Integer @@ -137,40 +140,20 @@ Dim protocolVersion As String Dim connected As Boolean Dim responseNumber As Integer - -Private Sub Command1_Click() - - ' build the contents of the XML packet. - xml = "" - - ' Use the first winsock control to send a UDP packet. - UDPSock.RemoteHost = filterHostname - UDPSock.RemotePort = filterUDPPort - UDPSock.SendData xml - Status.Caption = "i-scream Winhost " & protocolVersion & " - UDP packet sent." - -End Sub - - -Private Sub Command3_Click() - ' establish a TCP connection to a filter - TCPSock.Close - TCPSock.Connect filterHostname, filterTCPPort -End Sub - Private Sub Form_Load() + x = MsgBox(Date2Num()) + protocolVersion = "1.1" - + Status.Caption = "Loading" Form1.Caption = "i-scream Winhost " & protocolVersion ''''TEMP filterManagerHostname = "killigrew.ukc.ac.uk" filterManagerTCPPort = 4567 - Reconfigure_Click - Exit Sub - ''' ENDTEMP + ''''' END TEMP + GoTo skip On Error GoTo iniError Dim buf As String * 256 Dim length As Long @@ -178,8 +161,10 @@ Private Sub Form_Load() filterManagerHostname = Left$(buf, length) length = GetPrivateProfileString("i-scream Winhost", "FilterManagerPort", "", buf, Len(buf), App.Path & "winhost.ini") filterManagerTCPPort = Left$(buf, length) - +skip: + Status.Caption = "Connecting to Filter Manager" + Reconfigure_Click Exit Sub @@ -344,7 +329,27 @@ Private Sub Timer1_Timer() If Label3.Caption < 1 Then ' build the contents of the XML packet. - xml = "" + localIP = TCPSock.localIP + machineName = TCPSock.LocalHostName + seqNo = seqNo + 1 + packetDate = Now() + xml = "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" & _ + "" + Text4.Text = Text4.Text + xml ' Use the first winsock control to send a UDP packet. UDPSock.RemoteHost = filterHostname @@ -362,3 +367,7 @@ Private Sub Timer1_Timer() End If End Sub + +Function Date2Num() As Long + Date2Num = DateDiff("s", "1-1-1970", Now) +End Function