Sign in to follow this  
Followers 0
m0nk3yI3unz

TCPConnect Wont Die...

3 posts in this topic

Hey all. I dont usually need help, especially with the TCP functions (Ive used them a lot) but this one is stumping me...

I have a script which pings the server I want it to connect to, and if it's there, to connect to it (even if the application it's trying to connect to isn't running - It's supposed to check for that). The TCPConnect function, when called, is either connect the first time, or kill the program - no loops. Problem is, the program is hanging up on that command. I need it to try once, then if it doesn't connect, to kill the app.

My Code:

w("TCP Services Started! Connecting to server...")
setMsg("Connecting to update","server....","Started...")
Global $Connect = TCPConnect($IP,$UPORT)
switch $Connect
    case $Connect > 0
        setMsg("Connected successfully.","Retriving token...")
    case -1
        switch @error
            case 1
                ;                                                             <================= ERROR NUM 501
                msgbox(48,"ERROR","IP address of server is incorrect, or server is offline. Please try again later, or see site for details."&@CRLF&"ERROR NUM: 501")
                Exit
            case 2
                ;                                                             <================= ERROR NUM 502
                msgbox(48,"ERROR","Server port is incorrect, or server is offline. Please try again later, or see site for details."&@CRLF&"ERROR NUM: 502")
                Exit
        EndSwitch
EndSwitch

Monkeh.

Share this post


Link to post
Share on other sites



Have you tried setting TCPTimeout()?


Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites

I thought the default was 100 milliseconds muttley Lemme try it... Nope - still freezes.


Monkeh.

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