[PATCH] Allow to setup connect timeout for TCP transport

Pavel Strashkin pavel.strashkin at gmail.com
Mon Jan 17 12:33:35 PST 2011


Hello everyone,

There is no way to setup connect timeout when you're trying to connect
to dbus via TCP. For an example, if you have the following connection
string "tcp:host=A,port=B", and host "A" is unavailable by some reason
then your client will get in stuck. When it come back or when
ETIMEDOUT error happens depends on OS. Get in stuck is a bad thing so
there has to be a way to configure connect timeout via "timeout"
keyword in connection string. The value is in miliseconds. Default
timeout may be 60s.
Attached patch introduces such feature so it's possible to use the
following connection string: "tcp:host=A,port=B,timeout=5000" (5s
timeout). I believe that it's a very helpfull feature. I'm sorry that
my patch is for 1.2.24, but if everything is clear (logic, code, ...)
then i'll backport it to master branch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcp-connect-timeout.patch
Type: application/octet-stream
Size: 5979 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20110117/8aeffdb2/attachment.obj>


More information about the dbus mailing list