meekaah Posted August 26, 2007 Share Posted August 26, 2007 Hi, i have little telnet client in tcp and i want to wait for a specific string to continue with the script. but i dont seem to find anything that fits. he'res my little bit of code: TCPStartUp() $socket = TCPConnect( "169.254.0.2" , 23 ) If @error Then MsgBox(4112,"Error","Connexion not possible!") Exit EndIf sleep(400) $data = "cd /mnt/fat" $retour = tnSend($socket,$data) $data = "wget http://file.com/file" $retour = tnSend($socket,$data) TCPCloseSocket($socket) Func tnSend($socket, $texte) $retour = "" TCPSend($socket,$texte & chr(10)) If @error Then MsgBox(4112,"Error","TCPSend failed with WSA error: " & @error) Exit EndIf sleep(1000) $recv="fin" while $recv<>"" $recv = TCPRecv( $socket, 2048 ) If @error Then MsgBox(4112,"Error","TCPRecv failed with WSA error: " & @error) Exit EndIf sleep(100) $retour = $retour & $recv WEnd Return $retour EndFunc I want to wait for a "#" after the wget to know when the file is done downloading $data = "wget http://file.com/file" $retour = tnSend($socket,$data) Thanks in advance Link to comment Share on other sites More sharing options...
meekaah Posted August 26, 2007 Author Share Posted August 26, 2007 so, nobody has an idea? Link to comment Share on other sites More sharing options...
meekaah Posted August 27, 2007 Author Share Posted August 27, 2007 i can't beleive nobody knows this... im sure it's possible but can't find anything, im waiting for a little help, thanks in advance Link to comment Share on other sites More sharing options...
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