Astormooke Posted February 17, 2009 Posted February 17, 2009 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.
Richard Robertson Posted February 17, 2009 Posted February 17, 2009 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.
Astormooke Posted February 17, 2009 Author Posted February 17, 2009 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?
Richard Robertson Posted February 17, 2009 Posted February 17, 2009 No. Where did you ever get that idea?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now