if only one ip (not scan) it can connect but multi ip( scan ip) it not working
and i open command promt use "netstat -an" i see my ip have status SYN_SENT it what ? and can do resolve?
Code:Public buf Public Indexs As Integer Private Sub Command1_Click() Timer1.Interval = 1 End Sub Private Sub Command2_Click() Timer1.Enabled = False Timer2.Enabled = False End Sub Private Sub Form_Load() Indexs = 0 Text1(0).Text = "127" Text1(1).Text = "0" Text1(2).Text = "0" Text1(3).Text = "1" 'Call Sortip 'Timer1.Interval = 250 End Sub Private Sub Form_Unload(Cancel As Integer) Dim i If Winsock1.UBound = 0 Then Exit Sub For i = Winsock1.UBound To 0 Step 1 Winsock1(i).Close Unload Winsock1(i) Next i End Sub Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) If Len(Text1(0).Text) = 3 Then End If End Sub Private Sub Winsock1_Close(Index As Integer) If Index = 0 Then Exit Sub Winsock1(Index).Close Unload Winsock1(Index) End Sub Private Sub Timer2_Timer() On Error Resume Next 'Winsock1(Indexs).SendData "4444444444" If Winsock1(Indexs).State <> 7 Then 'Text2.Text = Text2.Text & "can not sending message" & Chr(13) & Chr(10) Else 'Text2.Text = Text2.Text & "connect IP SUCCESS:" & Indexs & Chr(13) & Chr(10) Text3.Text = Text3.Text & buf & Chr(13) & Chr(10) End If If Text1(3).Text < 255 Then Text1(3).Text = Text1(3).Text + 1 Else Text1(3).Text = 1 Text1(2).Text = Text1(2).Text + 1 End If If Text1(2).Text >= 255 Then Text1(2).Text = 0 Text1(1).Text = Text1(1).Text + 1 End If If Text1(1).Text >= 255 Then Text1(1).Text = 0 Text1(0).Text = Text1(0).Text + 1 End If If Text1(0).Text >= 192 Then Text1(0).Text = 192 End If Indexs = Indexs + 1 Timer1.Enabled = True Timer2.Enabled = False 'Else 'Text2.Text = Text2.Text & "connect IP SUCCESS" & Chr(13) & Chr(10) 'Timer1.Enabled = True 'Timer2.Enabled = False ' End If End Sub Private Sub Timer1_Timer() buf = Text1(0).Text & "." & Text1(1).Text & "." & _ Text1(2).Text & "." & Text1(3).Text If Indexs = 0 Then Winsock1(Indexs).Close Winsock1(Indexs).RemoteHost = buf Winsock1(Indexs).RemotePort = 1013 Winsock1(Indexs).Connect Else Load Winsock1(Indexs) Winsock1(Indexs).Close Winsock1(Indexs).RemoteHost = buf Winsock1(Indexs).RemotePort = 1013 Winsock1(Indexs).Connect End If Text2.Text = Text2.Text & Text1(0).Text & "." & Text1(1).Text & "." & _ Text1(2).Text & "." & Text1(3).Text & Chr(13) & Chr(10) Text3.Text = Text3.Text & Winsock1(Indexs).State & Chr(13) & Chr(10) 'Text2.Text = Text2.Text & "Connecting IP :" & buf & Chr(13) & Chr(10) 'Text2.Text = Text2.Text & "wait for sending message" & Chr(13) & Chr(10) Timer2.Enabled = True Timer2.Interval = 300 'Winsock1.SendData "55555" Timer1.Enabled = False End Sub Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim s Winsock1(Index).GetData s Text3.Text = s End Sub




Reply With Quote