-
Notifications
You must be signed in to change notification settings - Fork 18
added UnixSeqpacket and UnixSeqpacketListener. #25
base: master
Are you sure you want to change the base?
Conversation
…onsolidate into Inner
Depends upon rust-lang/libc#300 |
@@ -536,13 +717,13 @@ impl IntoRawFd for UnixStream { | |||
/// // close the listener socket | |||
/// drop(listener); | |||
/// ``` | |||
pub struct UnixListener { | |||
pub struct UnixStreamListener { |
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 think we should probably leave this as UnixListener
. It's a bit of an unfortunate naming setup, but that's what the standard library setup has, and it's slated for stabilization.
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.
:(
o.k.
On Fri, May 27, 2016, 12:42 AM Steven Fackler [email protected]
wrote:
In src/lib.rs
#25 (comment)
:@@ -536,13 +717,13 @@ impl IntoRawFd for UnixStream {
/// // close the listener socket
/// drop(listener);
/// ```
-pub struct UnixListener {
+pub struct UnixStreamListener {I think we should probably leave this as UnixListener. It's a bit of an
unfortunate naming setup, but that's what the standard library setup has,
and it's slated for stabilization.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rust-lang-nursery/unix-socket/pull/25/files/fcb59380b36d9182b7b83c1db74ef0c9f345674c#r64857039,
or mute the thread
https://github.com/notifications/unsubscribe/AAHlC24C1s3x9VvOxC7H9USyEkFBwTLXks5qFnZOgaJpZM4IoKe0
.
Yay! |
K. It's now UnixListener. Now it just needs the libc branch merged. |
Is this still blocked on libc? |
Yes. The PR for SEQPACKET was merged but a new version has not been pushed On Thu, Jun 2, 2016 at 1:54 AM Steven Fackler [email protected]
|
(ping @alexcrichton) |
"Seqpacket" here seems kinda long but beyond that seems reasonable to me! |
A new libc release landed, so you should be able to bump the version to 0.2.12 and get things building. |
There is another conflict: libc depends on tempdir which depends on rand which depends on libc 0.2.11. |
Unless it depends on |
I'm trying to sort this out. Rand states that it depends on 0.2, but I'm getting:
oddly, if I specify I depend on libc = "0.2" instead of "0.2.12" it downloads and compiles 0.2.12. specifying 0.2.12 states that only 0.2.11 is available. |
Try a |
Looks like this needs a rebase and then it should be ready to go! |
Hi, I'd like to help out with finishing this. @rrichardson, did you still plan to work on it, or is it ok if I rebase and re-submit the pull request? Or is it better to directly add to libstd now (seeing #27)? |
Wow, I totally forgot about this. I guess rebase and give it a go. |
Hey again, I tried writing an RFC for it (since it's an addition to std): https://github.com/dkl/rust-rfcs/blob/unixsocket-seqpacket/text/0000-unix-socket-seqpacket.md |
The API description in the RFC seems reasonable to me, but I don't think a full RFC is required for an addition like this - a PR direct to add the types (as unstable) should be fine! |
plus minor refactoring to consolidate into Inner.
This addresses issue #23
This would be much nicer with generic impl specialization :)
UnixStreamListener and UnixSeqpacketListener are 99% alike. In fact, in their implementations they only differ in 3 words, unfortunately, two of those are in return types, so there wasn't a clean way to factor them out, aside from making some sort of UnixSocket trait. So we're stuck with it unless we want to get crazy.
I moved send and recv into Inner which cleaned up some code in UnixStream and UnixDatagram while reducing the amount to duplicate into UnixSeqpacket.
Added a test for basic seqpacket functionality. All of the rest of the tests still pass.