Open dereckson opened 8 years ago
At the moment it's not straight forward to do, because we clone connection for a reading loop and for channel writes. Since openssl v0.9, the try_clone
method was removed from the TcpStream wrapper. So now it's impossible to do a concurrent writes/reads from different threads.
@Antti Is there any progress on this? Do you need help?
@Keruspe the biggest issue here is that new SslStream
does not implement clone
or try_clone
. Thus making multithreaded reads and writes impossible.
I need to completely rewrite frames reading/dispatching code to make it work.
Any news? I've used the amqp crate in one of my projects and I'm not able to compile it anymore because it's pulling in openssl 0.7
Need as well, after an Archlinux upgrade I'm unable to compile the lib.
@Antti I wonder if I could wrap the connection in a Arc<Mutex<...>> and share the writes with that?
(without having to rebuild everything else ...) if you're available on IRC, ping me: gchristensen (freenode, mozilla.)
I have an implementation using the openssl crate version 0.9.x here: https://github.com/Antti/rust-amqp/pull/59
@grahamc Mutex won't work, since it will lock socket for reading as well and will result in the deadlock.
Yeah, I found that to be true quite quickly :( I used a different approach.
Not to bug, but is there any movement on this that we can maybe assist on? Currently not possible to use this library alongside Hyper due to clashing openssl
crates and neither is compatible with the other.
OpenSSL 1.1 is coming on packages, for example it landed on Debian Sid next week.
That calls to bump the
openssl
crate dependency to 0.9.As the
openssl
0.7 create doesn't support OpensSL 1.1, as soon as an operating system or a Linux distribution bumps to OpenSSL 1.1, it becomes impossible to compile theamqp
crate.The upgrade isn't straightforward, as both the
openssl
crate and OpenSSL API changed, mostly:TLS_method
instead ofSSLv23_method
, so SslMethod::Sslv23 dosn't exist anymore inopenssl
crate