Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: logdog/client/butlerlib/streamclient/client_namedPipe_windows.go

Issue 2866473002: Revert "Switch from "winio" to "npipe"." (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « logdog/client/butler/streamserver/namedPipe_windows_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package streamclient 5 package streamclient
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "io" 9 "io"
10 10
11 » "gopkg.in/natefinch/npipe.v2" 11 » "github.com/Microsoft/go-winio"
12 ) 12 )
13 13
14 func registerPlatformProtocols(r *Registry) { 14 func registerPlatformProtocols(r *Registry) {
15 r.Register("net.pipe", newNamedPipeClient) 15 r.Register("net.pipe", newNamedPipeClient)
16 } 16 }
17 17
18 // newNamedPipeClient creates a new Client instance bound to a named pipe stream 18 // newNamedPipeClient creates a new Client instance bound to a named pipe stream
19 // server. 19 // server.
20 func newNamedPipeClient(path string) (Client, error) { 20 func newNamedPipeClient(path string) (Client, error) {
21 if path == "" { 21 if path == "" {
22 return nil, errors.New("streamclient: cannot have empty named pi pe path") 22 return nil, errors.New("streamclient: cannot have empty named pi pe path")
23 } 23 }
24 24
25 return &clientImpl{ 25 return &clientImpl{
26 factory: func() (io.WriteCloser, error) { 26 factory: func() (io.WriteCloser, error) {
27 » » » return npipe.Dial(LocalNamedPipePath(path)) 27 » » » return winio.DialPipe(LocalNamedPipePath(path), nil)
28 }, 28 },
29 }, nil 29 }, nil
30 } 30 }
31 31
32 // LocalNamedPipePath returns the path to a local Windows named pipe named base. 32 // LocalNamedPipePath returns the path to a local Windows named pipe named base.
33 func LocalNamedPipePath(base string) string { 33 func LocalNamedPipePath(base string) string {
34 return `\\.\pipe\` + base 34 return `\\.\pipe\` + base
35 } 35 }
OLDNEW
« no previous file with comments | « logdog/client/butler/streamserver/namedPipe_windows_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698