Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit fdaaaa8

Browse files
authored
Merge pull request #2 from anarkioteam/add-ib-client-connected-check
Add IbClientAdapter#ib_client_connected?
2 parents 8a7e5b7 + e5ae757 commit fdaaaa8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/ib_ruby_proxy/server/ib_client_adapter.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def initialize(ib_client, ib_wrapper_adapter)
2626
@ib_wrapper_adapter = ib_wrapper_adapter
2727
end
2828

29+
def ib_client_connected?
30+
@ib_client.isConnected
31+
end
32+
2933
# @param [IbRubyProxy::Client::IbCallbacksObserver] ib_callbacks_observer
3034
def add_ib_callbacks_observer(ib_callbacks_observer)
3135
ib_wrapper_adapter.add_observer(ib_callbacks_observer)

lib/ib_ruby_proxy/server/ib_proxy_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ module Server
2020
# * Starts an IB message-processing thread that will dispatch messages sent to IB client app (
2121
# gateway or TWS)
2222
class IbProxyService
23-
DEFAULT_IB_HOST = 'localhost'
23+
DEFAULT_IB_HOST = 'localhost'.freeze
2424
DEFAULT_IB_GATEWAY_PORT = 4002
25-
DEFAULT_DRB_HOST = 'localhost'
25+
DEFAULT_DRB_HOST = 'localhost'.freeze
2626
DEFAULT_DRB_PORT = 1992
2727

2828
# @param [String] ib_host Hostname for the IB client app (gateway or TWS). Default +localhost+

0 commit comments

Comments
 (0)