Skip to main content

get_or_connect

Function get_or_connect 

Source
pub async fn get_or_connect(
    host: &str,
    port: u16,
    client_id: i32,
    connection_timeout_secs: u64,
) -> Result<SharedClientHandle>
Expand description

Returns a handle to the shared IB client for the given (host, port, client_id). If a connection already exists, its ref count is incremented and the same client is returned. Otherwise a new connection is established and registered.

ยงErrors

Returns an error if connecting to IB Gateway/TWS fails.