Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

fixes #2 Add support for Named Pipes on Windows #318

Merged
merged 1 commit into from
Jun 8, 2018

Conversation

gdamore
Copy link
Collaborator

@gdamore gdamore commented Jun 7, 2018

This adds support for Windows Named Pipes as ipc:// URLs that are
compatible with nanomsg and NNG.

It also includes (untested) support for SecurityDescriptor and
InputBufferSize and OutputBufferSize tunables. It is built on
the github.com/Microsoft/go-winio library.

Note that legacy libnanomsg (all versions 1.1.3 and earlier) is
very fragile in it's handling of IPC, and assumes that senders
will only send a single atomic write. This assumption requires
us to make an extra data copy. (Note that NNG has no such assumptions,
and we could easily dispense with the data copy for NNG.)

This adds support for Windows Named Pipes as ipc:// URLs that are
compatible with nanomsg and NNG.

It also includes (untested) support for SecurityDescriptor and
InputBufferSize and OutputBufferSize tunables.   It is built on
the github.com/Microsoft/go-winio library.

Note that legacy libnanomsg (all versions 1.1.3 and earlier) is
very fragile in it's handling of IPC, and assumes that senders
will only send a single atomic write.  This assumption requires
us to make an extra data copy.  (Note that NNG has no such assumptions,
and we could easily dispense with the data copy for NNG.)
@@ -0,0 +1,87 @@
// +build windows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually, this comes up after the license blurb.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know that worked -- I've used this scheme in my other projects with the same placement. Thinking about it though, I think it's actually better having this where it is -- it immediately calls out the platform(s) where this relevant (or not). Its a small enough thing (one line only) that I don't think it dilutes the license blob in many meaningful way where it is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conversely, our license blurb is a little longer (shorter than the BSD blurb in the go runtime for example) -- so sticking this below would easily lead it to being "lost" in the confusion. I'm also not sure if go needs this in the first "n" lines, or just before the first non-whitespace/non-comment line, or anywhere in the file.

At any rate, I plan to leave it where it is -- at least unless it triggers some warning from go vet or something like that. (Pretty sure it doesn't.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing some failures with containers and in the test suite at AppVeyor:

The problem is the underlying named pipe library -- the following fix should address it:

microsoft/go-winio#75

This is also described here:

microsoft/go-winio#67

@gdamore gdamore merged commit 6e946f1 into nanomsg:master Jun 8, 2018
@gdamore gdamore deleted the winpipes branch June 8, 2018 00:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants