--- experimental/host/vb_net_test/nettest.frm 2001/02/23 09:42:36 1.2 +++ experimental/host/vb_net_test/nettest.frm 2001/02/23 10:07:55 1.3 @@ -120,8 +120,10 @@ Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim filterHostname As String -Dim filterTCPPort As String -Dim filterUDPPort As String +Dim filterTCPPort As Integer +Dim filterUDPPort As Integer +Dim fileList As String +Dim lastModified As String Dim protocolVersion As String Dim connected As Boolean @@ -139,14 +141,16 @@ End Sub Private Sub Command2_Click() - ' establish a TCP connection to a machine + ' establish a TCP connection to a filtermanager Winsock2.Close Winsock2.Connect Text3.Text, Text2.Text End Sub Private Sub Command3_Click() - x = MsgBox("not implemented..") + ' establish a TCP connection to a filter + Winsock2.Close + Winsock2.Connect filterHostname, filterTCPPort End Sub Private Sub Form_Load() @@ -157,8 +161,14 @@ Private Sub Winsock2_Connect() responseNumber = 0 - ' As soon as we are connected to the server, send this. - Winsock2.SendData "STARTCONFIG" & vbCrLf + ' Send something as soon as we connect to the server. + If connected = False Then + ' contact the FilterManager + Winsock2.SendData "STARTCONFIG" & vbCrLf + Else + ' Contact the Filter + Winsock2.SendData "HEARTBEAT" & vbCrLf + End If End Sub @@ -183,9 +193,11 @@ Private Sub Winsock2_DataArrival(ByVal bytesTotal As L Winsock2.SendData "LASTMODIFIED" & vbCrLf Case 2: If response = "ERROR" Then GoTo configError + lastModified = response Winsock2.SendData "FILELIST" & vbCrLf Case 3: If response = "ERROR" Then GoTo configError + fileList = response Winsock2.SendData "UDPUpdateTime" & vbCrLf Case 4: If response = "ERROR" Then GoTo configError @@ -223,21 +235,21 @@ Private Sub Winsock2_DataArrival(ByVal bytesTotal As L On Error GoTo heartbeatError Select Case responseNumber Case 1: - + If Not response = "OK" Then GoTo heartbeatError + Winsock2.SendData "CONFIG" & vbCrLf Case 2: - + If Not response = "OK" Then GoTo heartbeatError + Winsock2.SendData fileList & vbCrLf Case 3: - + If Not response = "OK" Then GoTo heartbeatError + Winsock2.SendData lastModified & vbCrLf Case 4: - + If Not response = "OK" Then GoTo heartbeatError + Winsock2.SendData "ENDHEARTBEAT" & vbCrLf Case 5: - - Case 6: - - Case 7: - - Case 8: - + If Not response = "OK" Then GoTo heartbeatError + Winsock2.Close + x = MsgBox("heartbeat sent okay.") End Select End If