how to adjust outgoing socket connection timeout

My colleague and I are Arduino newbies. We are trying to get our Arduino to connect to port 8000 on my Linode where I have a custom daemon running.

When I run my test piece of Linux C code from my side, I see that there is often a delay of tens of seconds before my Linode accepts the socket.

My colleague (the Arduino developer at this point) is reporting that he has to program a multiple try socket connection algorithm to have a chance of getting a successful connection before the "internal timeout" kicks in. He says that it often takes 6-10 "kicks" before a successful connection is made. Each "kick" the code returns with an unsuccessful connect after what appears to be a timeout period.

I will try to get some source code and a more detailed return code description, but meanwhile I thought I would ask if there is a way to adjust this timeout value in the Arduino library.

Thanks in advance for your help.

bob

You can set the timeout in a register of the WizNet5100 chip (see page 22 of the datasheet). In my opinion you should search for the error on the Linode side. A linux box waiting tens of seconds before accepting an incoming connection has a serious problem or your custom daemon has a poor design.

Just ran a quick test from my Linux workstation here. My Linux test stub took 6 sec to establish a socket to my Linode. This was "comparable" to the 12 sec it took for my ssh session to produce a login prompt.

I'm still awaiting the source code and return code description for the Arduino connect problem. As soon as I get it I will post here.

Thanks again for your response.

bob
PS.
The URL for my Linode is icanprogram.ca. The port is 8000. If someone wants to give it an independent try.

PS2.
The ultimate goal of our little project is to produce a client for this protocol for the Arduino: http://www.icanprogram.com/simpl/tclSurrogate.html

I got a connection to icanprogram.ca:8000 within less than a second. Seems to be your network that's making the problem.

Just curious if your connection was via an Arduino?

Thanks.

bob

No, I used the telnet command on my computer (Linux box), you told us you're doing the same and wait for more than 6 seconds, didn't you? My Arduinos are usually on a separate segment of my network without direct internet connectivity, so that would be a bit more of work to establish.