-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
net: add net.Dialer and net.Connection interfaces, abstracting the different types of connections, already supported by the V network stack #21657
Conversation
0c861ac
to
c203a72
Compare
(rebased over current master) |
What do you think of |
Yeah, Hungarian notation was them wanting to let you know the type as part of the name, but just being lazy and not wanting to type the whole thing out. :-\ |
I ran:
For comparison,
I think that adding an |
However, we already do have |
Since you have to include the |
Agreed. |
From my thread on Discord:
The idea here is to create new interfaces around network connections and then migrate the protocol implementations to work around these interfaces. This is one of the parts of Golang that makes it so flexible. This PR demonstrates a potential interface for dialing new network connections and another potential interface for implementing protocols on top of those connections.
If the feedback here is favorable I will tackle a larger protocol (HTTP).
Note
I don't love the I____ style interface names but I'm trying to propose this in a way that is backwards compatible to existing code written against vlib. If breaking the contract is an option then we can have better names and likely simplify many of the written protocols.