Skip to content

Commit

Permalink
Fix eConnect wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrinr committed Mar 14, 2015
1 parent 4c66de4 commit 3af64aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions swigibpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ def __init__(self, *args):

class TWSPoller(threading.Thread):
'''Continually polls TWS for any outstanding messages.
Loops indefinitely until killed or a fatal error is encountered. Uses
socket select to poll for input and calls TWS's
`EClientSocketBase::checkMessages` function.
Expand Down Expand Up @@ -2050,7 +2050,7 @@ def __init__(self, ptr):
"""__init__(EPosixClientSocket self, EWrapper ptr) -> EPosixClientSocket"""
_swigibpy.EPosixClientSocket_swiginit(self,_swigibpy.new_EPosixClientSocket(ptr))
__swig_destroy__ = _swigibpy.delete_EPosixClientSocket
def eConnect(self, host, port, clientId=0, extraAuth=0, poll_auto=True):
def eConnect(self, host, port, clientId=0, extraAuth=False, poll_auto=True):
val = _swigibpy.EPosixClientSocket_eConnect(self, host, port, clientId, extraAuth)
if poll_auto and val:
self.poller = TWSPoller(self)
Expand Down
8 changes: 4 additions & 4 deletions swigify_ib.i
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef std::string IBString;
%template(OrderComboLegList) std::vector<boost::shared_ptr<OrderComboLeg> >;
%template(TagValueList) std::vector<boost::shared_ptr<TagValue> >;

/*
/*
TWS use their own shared_ptr class, need to fool SWIG into thinking
it's the standard boost::shared_ptr.
This means the generated cpp file must be post-processed to remove
Expand Down Expand Up @@ -119,7 +119,7 @@ from traceback import print_exc

class TWSPoller(threading.Thread):
'''Continually polls TWS for any outstanding messages.
Loops indefinitely until killed or a fatal error is encountered. Uses
socket select to poll for input and calls TWS's
`EClientSocketBase::checkMessages` function.
Expand All @@ -146,8 +146,8 @@ class TWSPoller(threading.Thread):
break
%}
%feature("shadow") EClientSocketBase::eConnect(const char *host, unsigned int port, int clientId=0, bool extraAuth=0) %{
def eConnect(self, host, port, clientId=0, extraAuth=0, poll_auto=True):
%feature("shadow") EClientSocketBase::eConnect(const char *host, unsigned int port, int clientId=0, bool extraAuth=false) %{
def eConnect(self, host, port, clientId=0, extraAuth=False, poll_auto=True):
val = _swigibpy.EPosixClientSocket_eConnect(self, host, port, clientId, extraAuth)
if poll_auto and val:
self.poller = TWSPoller(self)
Expand Down

0 comments on commit 3af64aa

Please sign in to comment.