-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make libuv server api semantically similar to asio #52
Conversation
02e48b9
to
baddf59
Compare
@tchernobog thoughts? |
I think in general this is a good change. Thanks! The only item where I am thinking that it is a bit asymmetric, is that:
On one hand, we assume the initialization is done by an external entity. On the other, responsibility for de-initialization is moved to this object. I wonder if there are good use cases for reusing the socket or other reasons to avoid passing ownership. In that case closing should be up to the caller. Otherwise, as a compromise, I would prefer if at least the parameter had type |
I did think this would be better to have |
This is essentially building upon the work done in #42 and #44, which allowed the server to run using an external libuv event loop. But instead of using an external loop this change allows the internal uv loop to be run externally or add external events to the loop.
Main advantage of this change is that it makes the libuv server API semantically similar to asio server API, without removing functionality. It also makes the code a bit simpler since we don't have to check if it's an external loop or not.