Komnomnomnom / swigibpy

Third party Interactive Brokers Python API generated from TWS C++ API using SWIG.
http://github.com/Komnomnomnom/swigibpy/
Other
155 stars 36 forks source link

Broken socket when using multiple EPosixClientSocket in different processes #47

Closed CLevasseur closed 8 years ago

CLevasseur commented 8 years ago

We're getting an error when using multiple EPosixClientSocket in different processes:

509: Exception caught while reading socket - Connection reset by peer

And a similar error is written in log files:

[DH] INFO [JTS-usfutureListenerS18-29710] - Disconnecting cdc1.ibllc.com:4000 with status DISCONNECT_ON_BROKEN_SOCKET

Its occurs as soon as some data are received from TWS. Everyting works fine if we execute pieces of code so that only one socket is used. Using poll_auto=False removes the error but since no other Poller is used, TWS messages are not handled.

We use swigibpy 0.5.0 and TWS Build 956.2d

Komnomnomnom commented 8 years ago

Thanks @CLevasseur I haven't seen this before, do you have a small test case (code) that reproduces the bug?

CLevasseur commented 8 years ago

The bug was in our code, we gave the argument clientid instead of clientId to EPosixClientSocket.eConnect, and somehow we missed it during our tests, so every client used clientId 0 (default), so only the first socket could connect