arthurlm / quickfix-rs

Unofficial rust binding of QuickFIX library
https://docs.rs/quickfix/latest/quickfix/
Other
13 stars 5 forks source link

Add ability to logout of a session #17

Closed aaiyer closed 2 weeks ago

aaiyer commented 2 weeks ago

Add the ability to logout of a session using it's session id

arthurlm commented 2 weeks ago

Hi Aaiyer 😬 Thanks a lot for your contribution 👍 !

I made few small changes in order to make API closer to official QuickFIX library. It will also be easier in the future to bind new Session methods.

Unfortunately I marked Session::lookup as unsafe because of lifetime issue... Next time I reach Oren Miller (official maintainer of QuickFIX C++ library), I will ask him if there is a way to solve this issue.

Let me know if everything work as expected on your side or if you have any issue.

arthurlm commented 2 weeks ago

Just giving you an update:

I finally find a way to borrow safely a FIX::Session from SocketAcceptor / SocketInitiator. Please have a look at this commit: https://github.com/arthurlm/quickfix-rs/commit/da9095acc41d179dec1d9641e3963aa1ee53afa0

The main idea is to avoid dealing with Session::lookup which use global variables and to use inner socket acceptor / initiator members.

Please let me know if you have any other issue or if something is not clear 😀.