well...
i got some updates about this...
The solution above (the last one) makes the scan routine more effective, because i can make it faster and more accurate with it! The ports can be scanned faster and using the socket event SocketClient_Ready, it makes it very accurate detecting "regular" open ports!

But the same bottleneck still exist on the program. It's the only think (on this version) that really doesnt work: scanning remote hosts!

On LAN's it's perfect, faster and very accurate, only needs some service detection (...later

), but now, this problem needs to be solve, or the scanner wil only be usefull for LAN scanning
Either external IP's or domains cant be successfully scanned.
Heres the actual "scan core":
'defining connection socket
PUBLIC Connection AS NEW Socket AS "SocketClient"
'setting the screen counter
PUBLIC screenCount AS Integer
PUBLIC SUB btn1_Click()
DIM targethost AS String
DIM minportas AS Integer
DIM maxportas AS Integer
'linking host variable with inputs
targethost = target.text
'linking port variables with inputs
minportas = minPort.Text
maxportas = maxPort.text
'defining screen counter
screenCount = 0
'defining range for the scan routine
FOR minportas = minportas TO maxportas
'connects to target host on current port
Connection.Connect(targethost, minportas)
'waits until connection is closed or error is found
REPEAT
WAIT 0.01
UNTIL Connection.Status <= Net.Inactive
'checks if hostname was found
IF Connection.Status = Net.HostNotFound THEN
screen.Add("Hostname not found...", 0)
BREAK
ENDIF
'displays current port...
current.text = minportas
'counts open ports
openCount.text = screenCount
NEXT
END
PUBLIC SUB SocketClient_Ready()
'found open port...
screen.Add("Port: " & Connection.Port & " | Status: Open", screenCount)
'close the connection
CLOSE #Connection
'increment screen counter
screenCount = screenCount + 1
END
Once again, thanks for your help!
Best regards!
----------------------------------------------------------------------------------------------
EDIT: Download Current Source Package (alpha2)----------------------------------------------------------------------------------------------