How to achieve per ORB/thread client connection timeouts

Thomas Braun via omniORB-list <[email protected]> Thu, 18 Jun 2026 22:42:59 +0200
Newsgroups gmane.comp.corba.omniorb.user
Message-ID <[email protected]>
Hi,

in tango controls we have a multithreaded client part of the program
which has multiple ORBs it connects to.

One of them is usually really busy, so the current code does something
like

class AutoConnectTimeout
{
  public:
    AutoConnectTimeout(unsigned int to)
    {
        omniORB::setClientConnectTimeout((CORBA::ULong) to);
    }

    ~AutoConnectTimeout()
    {
        omniORB::setClientConnectTimeout(NARROW_CLNT_TIMEOUT);
    }
};
} // namespace

const int NARROW_CLNT_TIMEOUT = 100;
const int DB_RECONNECT_TIMEOUT = 20000;

// code get's RAII object to change connect timeout

AutoConnectTimeout act(DB_RECONNECT_TIMEOUT);

The obvious issue is that the client connect timeout change is global,
so while the RAII object is in place also other threads connecting to
other ORBs see the modified connect timeout.

Am I missing something or is a per thread/ORB client connect timeout
not possible? Or am I misunderstanding things?

Thanks,
Thomas