Jump to content

TCPConnect( $sIPAddr , $iPort [, $iTimeOut ] )


JScript
 Share

Recommended Posts

  • 2 years later...

I usually hate necro-posting but I'm writing here because I think this snippet will be very useful to everyone who will use Autoit with sockets in the future.

The function doesn't work as expected with time interval values that are not a multiple of seconds because the second parameter of timeval structure used by winsock "select" function must be expressed in microseconds while actually the snippet expresses it in millisecond.

The correction is very simple: just replace

DllStructSetData($to, 2, Mod($iTimeOut, 1000))

with:

DllStructSetData($to, 2, Mod($iTimeOut, 1000) * 1000)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...