mbkowns Posted December 8, 2008 Share Posted December 8, 2008 If I connect to a IP with TCPConnect( $g_IP, 80 ) and use a IP that went down or doesn't exist in DNS it has a huge delay for a response. How can I make this faster? I have tried setting with zero effect. Opt("TCPTimeout",10) $g_IP = "10.82.1.37" Opt("TCPTimeout",10) $time = @HOUR & ":" & @MIN & ":" & @SEC ; Start The TCP Services ;============================================== TCPStartUp() ; Connect to a Listening "SOCKET" ;============================================== $socket = TCPConnect( $g_IP, 80 ) msgbox(4096, "", $socket & @CR & "START: " & $time & @CR & "End: " & @HOUR & ":" & @MIN & ":" & @SEC) TCPShutdown() Link to comment Share on other sites More sharing options...
Christopher Posted December 24, 2008 Share Posted December 24, 2008 Well, The only thing I can think of is to make 2 scripts... (pseudo code, don't just copy+paste) Script 1: CODE #NoTrayIcon TCPStartup() TCPConnection($myip, 80) Func OnExit() TCPShutdown() EndFunc Script 2: CODE $check = Run "Script 1" sleep(500) ; Wait for as long as you want if ProcessExists($check) Then ProcessClose($check) MsgBox(0, "Error", "Server is down") EndIf ; Do your stuff ... Let us know how that works... also, if someone has a less hacky way, please share with us Link to comment Share on other sites More sharing options...
Morthawt Posted May 24, 2011 Share Posted May 24, 2011 Any resolution to this? It has a 20 second delay or more... I need to run a check on a port every 5 seconds not 20. Free and easy Autoit scripting video tutorials (plus more videos always coming!) General video tutorials, especially correct and safe TeamSpeak permissions tutorials. 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