Skip to content
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

x/sys/windows: named pipes support on Windows #16655

Open
runner-mei opened this issue Aug 10, 2016 · 10 comments
Open

x/sys/windows: named pipes support on Windows #16655

runner-mei opened this issue Aug 10, 2016 · 10 comments
Labels
Milestone

Comments

@runner-mei
Copy link

@runner-mei runner-mei commented Aug 10, 2016

  1. What version of Go are you using (go version)?
    go version go1.7rc3 windows/amd64
  2. What operating system and processor architecture are you using (go env)?
    set GOARCH=amd64
    set GOBIN=
    set GOEXE=.exe
    set GOHOSTARCH=amd64
    set GOHOSTOS=windows
    set GOOS=windows
    set GOPATH=d:\developing\go\xxx..\3td;d:\developing\go\meijing
    set GORACE=
    set GOROOT=d:\tools\go_amd64
    set GOTOOLDIR=d:\tools\go_amd64\pkg\tool\windows_amd64
    set CC=gcc
    set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\xxx\go-build491836642=/tmp/go-build -gno-record-gcc-switches
    set CXX=g++
    set CGO_ENABLED=1

On *nix we have unix sockets - a standard way of doing IPC (interprocess communication).
On windows we can use TCP sockets for doing the IPC, but a natural way of doing so according to this page (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx) is named pipes. Very close analogy to unix sockets. Providing net.NamedPipeConn in the net package sounds like a good idea to me. I need run web app on the pipe.

I find this issues #3599, but is closed. It provide a alternative package “gopkg.in/natefinch/npipe.v2”。 but it is unstable and low performance. All thread will blocked at syscall.WaitForSingleObject while Use PipeListener on the server.

@pi

This comment has been minimized.

Copy link

@pi pi commented Aug 10, 2016

Microsoft's implementation of named pipes for Go: https://github.com/Microsoft/go-winio

@bradfitz

This comment has been minimized.

Copy link
Contributor

@bradfitz bradfitz commented Aug 10, 2016

As @alexbrainman said previously, this doesn't need to live in the standard library, since the standard library tries to just be portable stuff. I would normally suggest putting this in https://golang.org/x/sys/windows but if Microsoft already provides it at https://github.com/Microsoft/go-winio, I'd just use that, no?

@bradfitz bradfitz added the OS-Windows label Aug 10, 2016
@alexbrainman

This comment has been minimized.

Copy link
Member

@alexbrainman alexbrainman commented Aug 11, 2016

I agree with what Brad said. Not many people will use this functionality. And the approach is not portable to other OSes.

I need run web app on the pipe.

Use some external library. Or write your own. It cannot be too complicated.

It provide a alternative package “gopkg.in/natefinch/npipe.v2”。 but it is unstable and low performance.

You have source code for it. You can fix it. Or write your own. Or use Microsoft's implementation as suggested by @pi. (I never looked at either library, and I wouldn't know how good / bad they are).

Alex

@runner-mei

This comment has been minimized.

Copy link
Author

@runner-mei runner-mei commented Aug 11, 2016

@alexbrainman
I don't have the ability to fix it ( “gopkg.in/natefinch/npipe.v2”).

https://github.com/Microsoft/go-winio It looks like can be used, but I still want to put it in https://golang.org/x/sys/windows

@quentinmit quentinmit changed the title os: named pipes support on Windows x/sys/windows: named pipes support on Windows Aug 11, 2016
@quentinmit quentinmit added this to the Unreleased milestone Aug 11, 2016
@alexbrainman

This comment has been minimized.

Copy link
Member

@alexbrainman alexbrainman commented Aug 12, 2016

I don't have the ability to fix it ( “gopkg.in/natefinch/npipe.v2”).

I am sorry, but I don't have time to fix it either.

Alex

@techtonik

This comment has been minimized.

Copy link

@techtonik techtonik commented May 26, 2017

@runner-mei where is the upstream issue for that in https://github.com/natefinch/npipe/issues ?

@runner-mei

This comment has been minimized.

Copy link
Author

@runner-mei runner-mei commented May 26, 2017

@techtonik 1. it is unstable. - https://github.com/natefinch/npipe/issues
2. The author is no longer maintained - https://github.com/natefinch/npipe/pulls

@techtonik

This comment has been minimized.

Copy link

@techtonik techtonik commented May 26, 2017

@techtonik 1. it is unstable. - https://github.com/natefinch/npipe/issues

Oh yea. golang is extremely unstable then. =)

  1. The author is no longer maintained - https://github.com/natefinch/npipe/pulls

Do you have test for your issue? natefinch/npipe#22 Or at least explanation of your commit? For example, I am not skilled to read where is the memory leak and how the code fixes it. Sometimes reviewing commits and writing tests for them takes much longer times than writing them.

@gdamore

This comment has been minimized.

Copy link

@gdamore gdamore commented Jun 24, 2018

I will be forking npipe, because it looks like both it and Microsoft's "official" win-io package are getting approximately zero support. I need this capability for my own software. Stay tuned.

@AlbinoGeek

This comment has been minimized.

Copy link

@AlbinoGeek AlbinoGeek commented Sep 20, 2018

There's also this NPFS.sys Named Pipes FileSystem built in to Windows that could be utilized to provide named pipes on WIndows... which I would like to know about.

Described well in: https://en.wikipedia.org/wiki/Named_pipe#In_Windows

.NET Framework 3.5 or newer as well as MongoDB and some other tools can use them (so far.)

There are also utilities for listing them:

http://read.pudn.com/downloads8/sourcecode/windows/24726/pipelist.c__.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.