-
Notifications
You must be signed in to change notification settings - Fork 68
WIP connection manager #246
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
Conversation
TimonPost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @fraillt !!
round 1
| @@ -0,0 +1,4 @@ | |||
| //! This module provides socket managers. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see a short description of what a socket manager is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you agree that I split SocketManager into two parts, as I wrote in the comment?
One would be ConnectionManagerFactory two methods accept_remote_connection, accept_local_connection, and the other would be SystemTracker?, SocketTracker?, MetricsCollector? ... you name it :) that would basically have these track_ methods.
Co-Authored-By: Timon <timonpost@hotmail.nl>
Mostly grammar fixes Co-Authored-By: Timon <timonpost@hotmail.nl>
ConnectionManagerError now is enum, with different error severity types. Multiple missing doc updates, renames, and minor refactorings.
|
I extracted part of I want to finish extract stuff from VirtualConnection, and leave it only simple struct with no implementation with these fields: pub struct VirtualConnection {
pub remote_address: SocketAddr,
pub reliability_system: ReliabilitySystem,
pub connection_manager: Box<dyn ConnectionManager>,
pub current_state: ConnectionState,
}and I would really like to put |
|
It is difficult to say if I would approve it. I do have questions and concerns. 1) This PR is quite big a lot of tests and logic is bound to virtual connection. So breaking that will break other stuff. That's where my second question comes in 2) What is your motivation behind those changes? Is it needed, are you having problems with implementing the feature. I prefer not to change anymore other than that is needed for the connection system. If you see some nice abstraction for |
|
Ye, I do agree with you, it would be best if I freeze this branch and only fix bugs and write tests. I'll remove this last commit. |
|
I've taken a bit of time to look through this and while I appreciate the need for connection management in laminar, I'm not too keen on this implementation. This feels very "bolted" on and not at all integrated with the solution proper. For example, I would expect something called Another bit of weirdness is around the caller API. Having to wrap I'm also worried about the proliferation of the Anyway, I urge you to rethink your implementation. I really do think that this feature is necessary and want to see it be a success because I'm really digging the end result but I think that it might be worth taking some extra time to figure out how to integrate it more holistically. Top suggestions:
|
|
I'm glad you addressed these points because most of them I don't like either. But they are more or less side effects of previous discussions. I guess I was trying to address too many things in this PR. This code, that you quoted, looks weird for me too, partially because part of the connection is constructed inside ActiveConnections and part of it in Socket implementation.
Maybe you have a better name to suggest?
Last questions: why do you think Ok, so until these questions are answered, I'll do the following:
pub enum ConnectionManagerEvent<'a> {
NewPacket(GenericPacket<'a>),
NewState(ConnectionState),
Error(ConnectionManagerError)
}
pub struct VirtualConnection {
remote_address: SocketAddr,
reliability_system: ReliabilitySystem,
connection_manager: Box<dyn ConnectionManager>,
current_state: ConnectionState,
}
So, let's get to work :) |
|
This PR is getting bigger, and bigger ... Code could be made much cleaner if we simply ignore SendError from the crossbeam. |
|
Since this PR gone out of control, in terms of what amount of code has changed. I decided to split it in smaller PR and prepare a code base for easier integration of connection manager in the future. |
This PR provides a concept of a connection with connected/disconnected states over UDP.
It provides two traits
ConnectionManagerandSocketManager, and implementation of these can be provided by the user. More discussion about it in this issue #242.The emphasis of this PR is a connection manager, although it also provides a socket manager concepts, after talking to @TimonPost on discord, I think it is wise to split it apart.
Currently, a socket manager basically does two things:
Probably it is wise to implement some metrics tracking in laminar itself, (some discussion about it is here #153.) and change
SocketManagertoConnectionManagerFactorywhich is only responsible for creatingConnectionManager.Decision making of whether to accept or reject new address can be addressed in the future.