login about faq


It seems that when using a socks 4/5 proxy with the Socket component, the connect timeout is ignored.

So if calling socket.Connect(hostname, port, true, 5000); I would expect to return within 5 seconds if the connection did not succeed.

However the result is that it takes around ~60 seconds, no matter what value is passed as the maxWaitMs.

In this specific case the socks proxy is working properly, although is blocked by this specific host so it will always timeout (but should respect the maxWaitMs value).

Chilkat Version: (I have tried previous versions as well and the result is the same)

asked Mar 24 at 01:36

Florin's gravatar image


A temporary solution would be welcome as well.


answered Apr 08 at 06:06

Florin's gravatar image


I'll have a look... :)


answered Apr 10 at 15:10

chilkat's gravatar image

chilkat ♦♦

Actually, I already know the answer. The timeout argument passed to the Connect method is just for the TCP connection establishment -- i.e. how long to wait for server to accept the TCP connection.

When a proxy is involved, there is a back-and-forth exchange of messages defined by the proxy protocol (such as SOCKS5). The timeouts for sending/receiving data on the socket are controlled by MaxReadIdleMs and MaxSendIdleMs. You would want to set these properties prior to calling Connect. The default value of these properties is 0, which means to wait forever, but I suspect that internally Chilkat is capping the timeouts (for the case of proxy connection establishment) to 60 seconds. I'll double-check...


answered Apr 10 at 15:15

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Mar 24 at 01:36

Seen: 391 times

Last updated: Apr 10 at 15:15

powered by OSQA