Unable to connect to the tradeapi server (sandbox or live)

22 Nov 2016, 14:36Unable to connect to the tradeapi server (sandbox or live)#1
rkaramc@gmail.composts: 12since: 26 Jul 2016

Hi!

i am unable to connect to the tradeapi server (both sandbox & live) due to a server timeout.

Am using python ssl to connect:

context = ssl.create_default_context()
ssl_socket = context.wrap_socket(socket.socket(socket.AF_INET), server_hostname=hostname)
ssl_connection = ssl_socket.connect((hostname, hostport))

where the time out exception is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/___/spotware/api/trading_api.py", line 69, in connect
    ssl_connection = ssl_socket.connect((hostname, hostport))
  File "/___/lib/python3.5/ssl.py", line 1019, in connect
    self._real_connect(addr, False)
  File "/___/lib/python3.5/ssl.py", line 1006, in _real_connect
    socket.connect(self, addr)
TimeoutError: [Errno 60] Operation timed out

Are there any parameters/config to be done when using the trading api?

Thanks
Rajeev

22 Nov 2016, 14:37RE:#2
rkaramc@gmail.composts: 12since: 26 Jul 2016

(hostname, hostport) are ('sandbox-tradeapi.spotware.com',5032) for the sandbox, and ('tradeapi.spotware.com',5032) for the live server..

Thanks
Rajeev