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

Add create windows socket functionality. #24

Closed

Conversation

m-kostrzewa
Copy link

This enables our app to act as a named pipe listener, which is useful when implementing remote drivers on Windows.

Signed-off-by: Michal Kostrzewa kostrzewa.michal@o2.pl

This enables our app to act as a named pipe server, which is useful when implementing remote drivers on Windows.

Signed-off-by: Michal Kostrzewa <kostrzewa.michal@o2.pl>
)

// NewWindowsSocket creates a Windows named pipe on the specified path.
func NewWindowsSocket(addr string, pipeConfig *winio.PipeConfig) (net.Listener, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Follow the conventions of Go's net package. This should be called Listen.

What is the purpose of adding this function? It looks like it could just be this:

var ListenWindowsSocket = winio.ListenPipe

Copy link
Author

Choose a reason for hiding this comment

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

I tried to make this symmetrical to unix_socket.go and tcp_socket.go. Should I rename and refactor "NewUnixSocket" and "NewTCPSocket" for this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

This package is an unmitigated disaster.

I guess just leave it as is.

Honestly, I don't see what value this function provides. It seems to be a passthrough.

Copy link
Author

@m-kostrzewa m-kostrzewa Dec 2, 2016

Choose a reason for hiding this comment

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

It pretty much is... Again, I added it for symmetry with other New*Socket functions. I'm not fond of the design either but I tried to adhere to it.

I can swap it with var ListenWindowsSocket = winio.ListenPipe if you think it'd be better.

I hear that you want to get rid of go-connections and I won't try to stop you. In any case, this changeset is mostly required for my other PR that depends on it docker/go-plugins-helpers#63

Copy link
Author

Choose a reason for hiding this comment

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

I moved Listener creation to go-plugins-helpers PR, this PR can be closed.

@stevvooe
Copy link
Contributor

stevvooe commented Dec 5, 2016

@m-kostrzewa Thank you for understanding. I'd rather not have this in here, especially if is just a pass through.

@stevvooe stevvooe closed this Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants