Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only first instantiated Client object can execute RPCs #3

Closed
TeWu opened this issue Sep 24, 2015 · 1 comment
Closed

Only first instantiated Client object can execute RPCs #3

TeWu opened this issue Sep 24, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@TeWu
Copy link
Owner

TeWu commented Sep 24, 2015

Only the first instantiated Client object can execute RPCs. Client object created after the first one raise exception when RPC method is invoked through it.

client1 = KRPC::Client.new.connect!
puts client1.space_center.ut #=> 9463.840156254686
client1.close

client2 = KRPC::Client.new.connect!
puts client2.space_center.ut #=> Exception: RPC call attempt while not connected to server -- call Client#connect first
@TeWu TeWu added the bug label Sep 24, 2015
@TeWu TeWu self-assigned this Sep 24, 2015
@TeWu
Copy link
Owner Author

TeWu commented Sep 24, 2015

RPC methods are bound to a single Client object. RPC method use the Client object that was in scope during that method (dynamic) creation. When second Client object is instantiated, RPC methods accessed through this object execute RPC calls using the first Client object's connection.

@TeWu TeWu added this to the v0.2.0 milestone Sep 25, 2015
@TeWu TeWu closed this as completed in db30556 Sep 26, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant