oanda / v20-python

OANDA v20 bindings for Python
MIT License
225 stars 91 forks source link

v20.Context #11

Closed alekna closed 8 years ago

alekna commented 8 years ago

I would like to suggest making the following changes to Context constructor:

  1. setting default ssl value to True (now it's False)
  2. setting default port value to 443
  3. adding token parameter as an alternative to Context.set_token()
  4. decreasing poll_timeout value to 2. Now it's 10 seconds which doesn't make any sense.
dmpettyp commented 8 years ago

These are mostly reasonable, I'm not sure about #4 though. It's currently set to 2x the hearbeat interval. Making it smaller than the heartbeat interval would cause timeouts to happen even though the stream is active.

alekna commented 8 years ago

That's what stream_timeout parameter is for. As I understand it poll_timeout means how long you should wait for SYN/ACK after SYN is sent.

dmpettyp commented 8 years ago

Ah, sorry I misread that. Yeah 2 is reasonable