lbilli / rib

An R implementation of Interactive Brokers API
GNU General Public License v3.0
34 stars 7 forks source link

Simple example crashing both rstudio and R client #3

Closed grandtiger closed 5 years ago

grandtiger commented 5 years ago

Thanks a lot for sharing this package! I am very excited to see it and try it as soon as I got home. Unfortunately, I couldn't get it to work. I am using RStudio 1.2.1335 and R 3.5.3. Every time I tried to run the following simple example, the code before line ic$checkMsg(2) works, but when running this line, RStudio 1.2.1335 or R 3.5.3 client will crash immediately. I can not see any error message before the crash. How can I trouble shoot this issue?

library(rib)

# Instantiate wrapper, client and connect
wrap <- IBWrapSimple$new()
ic   <- IBClient$new(wrap)
ic$connect(port=4002, clientId=1)

# Send requests, e.g.:
contract <- IBContract("GOOG")
ic$reqContractDetails(11, contract)

# more requests can go here...

# Parse responses.
# Might need to be called several times to process all messages
ic$checkMsg(2)

# Find results in
wrap$context

# Disconnect
ic$disconnect()
lbilli commented 5 years ago

Hi, thanks for trying it out. Few questions:

grandtiger commented 5 years ago

@lbilli sorry, I forgot to follow up until seeing your message about new release today. I just tried the latest version, it's not crashing rstudio on windows 10 any more. I used a different port and the error went away.