I am learning Xojo and am trying to build an IP address scanner, so I can see which servers are "online" at a given time.
I tried the TCPSocket example (from the Xojo documentation), as that allows me to connect to one server address easily without issues. However, the moment that try to enclose the code within a loop, so that it checks out a list of potential server addresses, it freezes without any explanation. Hmm...
dim soc As New TCPSocket dim counter as Integer for counter = 1 to 255 soc.Address = "10.0.1." + str(counter) soc.Port = 80 // Make connection attempt. soc.Connect // While attempting to connect... While Not soc.IsConnected If soc.LastErrorCode <> 0 Then Exit End If soc.Poll Wend // Finally, connected! If soc.IsConnected Then MsgBox("Connected.") End If // Now, disconnect. soc.Close next