libcoro
libcoro copied to clipboard
Make coro::net::ssl_context a shared_ptr when used with schedulers and clients
Right now in the example test_tcp_server.cpp:85 it passes the ssl contexts into the schedulers and clients by reference, this should ideally be by shared_ptr copy since the lifetimes are now bound.
I'm not sure this is the right thing to do now, perhaps each client or server should make their own context and just own it? I think my original idea was to allow the user to pass it between clients or servers to re-use them, but I think this makes the lifetimes ambiguous.
I agree. But at the very least it should accept a reference instead of a pointer - using raw pointers in C++ is known as bad practice.
I'm planning on dropping ssl support since it doesn't really seem necessary, and I don't have the time to support it, so going to close this one out.