ibapi icon indicating copy to clipboard operation
ibapi copied to clipboard

clientID clarification

Open icecolbeveridge opened this issue 9 months ago • 4 comments

Hello,

This is an odd edge case, and it's sort of on the boundary between ibapi and the tws system, but it doesn't seem to be documented clearly anywhere.

I hit a problem where I could connect to the client, but the handshake was timing out; I was able to connect with another script.

The bug turned out to be -- I believe -- that the clientID I was using was too large: in ibapi, it's an int64, but the tws docs only say int.

I don't know whether the correct fix is to use an int32 or to document that using too large a clientID will cause an unexplained failure, but I thought it was worth mentioning.

C

icecolbeveridge avatar Sep 08 '23 09:09 icecolbeveridge

Could you try using the biggest int64 and see if it fails?

zbednarke avatar Sep 12 '23 18:09 zbednarke

On my machine, using 18446744073709551615 as a clientID fails to complete handshake.

Digging a bit deeper:

  • 2147483646 (2^31-2) succeeds
  • 2147483647 (2^31-1) fails

On Tue, 12 Sept 2023 at 19:22, zbednarke @.***> wrote:

Could you try using the biggest int64 and see if it fails?

— Reply to this email directly, view it on GitHub https://github.com/hadrianl/ibapi/issues/45#issuecomment-1716215131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJGYIXYKPLONG53V7BN4ITX2CR7XANCNFSM6AAAAAA4QCPZR4 . You are receiving this because you authored the thread.Message ID: @.***>

icecolbeveridge avatar Sep 14 '23 13:09 icecolbeveridge

https://github.com/hadrianl/ibapi/blob/4f647c0e9c16555a4a1e6daaab674d8a41206cc4/utils.go#L180C12-L180C12

hadrianl avatar Sep 25 '23 01:09 hadrianl

I would fix this latter

hadrianl avatar Sep 25 '23 01:09 hadrianl