Home AMX User Forum NetLinx Studio
Options

IP_CLIENT_OPEN timeout

Is there a way to change the timeout for IP_CLIENT_OPEN?

It looks like the timeout is only 30 seconds.

From a DOS prompt, the SMTP server that I’m using normally takes 60-65 seconds to connect. Sometimes it connects immediately but most of the times it takes a little over a minute. I don’t know why it takes so long but that’s what I’m stuck with.

I could have sworn that the timeout for an IP_CLIENT_OPEN was 75 seconds at one time but that’s not the case anymore.

So does anyone know how to extend an IP_CLIENT_OPEN request for more than 30 seconds?

Thanks.

Comments

  • Options
    a_riot42a_riot42 Posts: 1,624
    By timeout do you mean the time it stays open once a connection is made, or how long it will attempt to make a connection?

    If its the former, I don't think there is a timeout. The socket will stay connected indefinitely until the server resets or ends the connection. If its the latter, then I don't think its changeable, since its probably a VXWorks setting that Netlinx doesn't have access to. Are you sure that's the problem though? I am thinking that the server is probably resetting and closing the connection rather than it timing out. If you watch wireshark during the connection attempt what do you see?
    Paul
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    a_riot42 wrote: »
    By timeout do you mean the time it stays open once a connection is made, or how long it will attempt to make a connection?

    If its the former, I don't think there is a timeout. The socket will stay connected indefinitely until the server resets or ends the connection. If its the latter, then I don't think its changeable, since its probably a VXWorks setting that Netlinx doesn't have access to. Are you sure that's the problem though? I am thinking that the server is probably resetting and closing the connection rather than it timing out. If you watch wireshark during the connection attempt what do you see?
    Paul
    It's the latter - how long IP_CLIENT_OPEN will attempt to make a connection until generating an ONERROR: 7: Connection timed out. You get 30 seconds.
  • Options
    a_riot42a_riot42 Posts: 1,624
    Joe Hebert wrote: »
    It's the latter - how long IP_CLIENT_OPEN will attempt to make a connection until generating an ONERROR: 7: Connection timed out. You get 30 seconds.

    Yes 30 seconds is what I've seen as well. I usually use 35 seconds as my wait time to attempt a retry. If the server is too busy to accept the socket connection within 30 seconds, then I don't see any way around it other than making multiple attempts every 30 seconds and hoping to get lucky, or using multiple ip_client_open requests to increase your chances of making a connection. Waiting over a minute for a STMP server is a pretty long time these days.
    Paul
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    a_riot42 wrote: »
    Waiting over a minute for a STMP server is a pretty long time these days.
    I agree but for some reason this one consistently takes 60-65 seconds and 1 in 20 tries it connects immediately. Ugh.

    Thanks for the feedback.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Problem solved.

    Instead of using port 25 I'm using port 587 and now I get immediate connects on a consistent basis.
  • Options
    a_riot42a_riot42 Posts: 1,624
    Joe Hebert wrote: »
    Thanks for the feedback.

    Glad I could help :)
    Paul
  • Options
    viningvining Posts: 4,368
    Joe Hebert wrote: »
    Problem solved.

    Instead of using port 25 I'm using port 587 and now I get immediate connects on a consistent basis.
    587 is also the port I've been using for the server I connect to but I've been using that for years and don't recall if it was because 25 gave me trouble as you've experienced or if I just read somewhere to use the alternate port. Some times dumb luck is better than no luck at all. :)
Sign In or Register to comment.