Sign in to follow this  
Followers 0
Astormooke

Need help dont know why this script is stopping...

4 posts in this topic

TCPStartup()
$dsdf = 0
Do
    $main_socket = TCPListen(@IPAddress1,$dsdf)
    ConsoleWrite("Searching... " & $dsdf)
    If $dsdf > 1 Then $dsdf = 0
    $dsdf = $dsdf + 1   
Until $main_socket > 0
Do
    $clt_socket = TCPAccept($main_socket)
Until $clt_socket > 0

$string &= "Connected at:" & $dsdf
ConsoleWrite($string)

Do
    $svr_socket = TCPConnect("69.64.64.125",15779)
Until $svr_socket > 0

$string &= "Connected to server" & @CRLF
GUICtrlSetData($Edit1, $string)

While 1
        $Recv = TCPRecv($svr_socket,4096)
        If $Recv  Then
            $string &= "Data recieved...  " & @CRLF & $Recv & @CRLF
            ConsoleWrite($string)
        EndIf
WEnd

The output of this script is...

Searching... 0Searching... 1

but I want it to look at every port between 0 and ten thousand...

any help would be greatly helpful.

Share this post


Link to post
Share on other sites



The logic of the script makes no sense. The way this will run is that it will try to listen on a port, and then if it can, it will try to accept a connection. It's going to sit at the first port it can listen on, which is 1. Then it will wait for something to connect to that port. Until then it will just sit there.

Share this post


Link to post
Share on other sites

The logic of the script makes no sense. The way this will run is that it will try to listen on a port, and then if it can, it will try to accept a connection. It's going to sit at the first port it can listen on, which is 1. Then it will wait for something to connect to that port. Until then it will just sit there.

doesnt the TCPListen time out though?

Share this post


Link to post
Share on other sites

No. Where did you ever get that idea?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0