-
Notifications
You must be signed in to change notification settings - Fork 31
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
Unix sockets (implements #42) #66
Conversation
The current design has some issues as source port numbers: * might be non-unique even on the same machine * can end up re-used by disparate clients connecting consecutively * don't exist for unix domain sockets Since the port numbers seem to be getting used to just uniquely identify a client, it makes more sense to allocate a unique ID per connection and use that instead.
hi, thanks! this looks great. regarding tests.. we don't really have any 😅 we'd either have to puppet some LSP client (like neovim) or mock it, but both of them have been too much effort for me to want to do them, i've instead spent time trying to make logs useful enough to debug problems retroactively when they happen during normal usage. i don't think it's fair to want you to add tests for this work, nor i think it's really necessary, all the transformations you made are really straight forward and i'd expect this to work fine^^ regarding pin-project. i'd prefer to use pin-project-lite considering we already have i in the dependency tree, i'll give it a stab too if there is a way to change it, we could probably just change the tuple variants to struct variants? |
Alright, I'll leave the to-do item but won't give it much priority then.
Nice suggestion, I have added this to my to-dos and will consider it. I think I considered using struct variants temporarily but that was before I discovered that pin-project-lite was already a dependency. Will try to come up with some updates tonight. Thanks for the quick glance at this, it's encouraging to hear you like the approach at least. |
also ad this
this isn't possible. if the enum is not pinned it's safe to move, and if it is pinned with |
The changes to the earlier commits are solely to address some things I had omitted from my previous WIP version.
I think the rest is superficial. |
just one small code style nitpick and i think this is done, good work :) thank you |
This is neater at the call site and makes it clear that this is only ever supposed to be an incremental ID and nothing else. As suggested by max (pr2502) in pr2502#66 (comment)
ok, i'm happy with this. if you just run |
This is neater at the call site and makes it clear that this is only ever supposed to be an incremental ID and nothing else. As suggested by max (pr2502) in pr2502#66 (comment)
I've pushed to fix the CI failure relating to formatting, now all the individual commits should pass formatting checks. All the remaining things can be done in a later PR. |
This allows the wrappers to be used in all circumstances where TcpListen, TcpStream, tcp::OwnedReadHalf, and tcp::OwnedWriteHalf are currently used.
was: replace pin-project with pin-project-lite taken from: #1
Since config::Address now exists, there's no real need to be generic and accept anything TcpStream::connect and UnixStream::connect accept and so a single function taking config::Address can simplify both call sites.
Same reasons as the connect_{tcp,unix} commit. Although there is currently only one call site.
This is neater at the call site and makes it clear that this is only ever supposed to be an incremental ID and nothing else. As suggested by max (pr2502) in pr2502#66 (comment)
Ah, I almost forgot, this last one is just with the |
thank you! :) |
I thought I would take a stab at implementing support for unix domain sockets. This involves:
There's a few things I still want to address:
Lastly, a few things I'm still considering and wouldn't mind others' opinions on:
I've not got that much experience with rust yet so let me know if there's some massively better way of doing anything I've done here. I know macros could be utilised to remove some of the repetition but I haven't really gotten around to learning about macros yet and felt that could be something which could be addressed at a later date.