| Index: client/logdog/butlerlib/streamclient/client_namedPipe_windows.go
|
| diff --git a/client/logdog/butlerlib/streamclient/client_namedPipe_windows.go b/client/logdog/butlerlib/streamclient/client_namedPipe_windows.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..75b242b466bc0a472ea570af48b4c0e4c6bddbdd
|
| --- /dev/null
|
| +++ b/client/logdog/butlerlib/streamclient/client_namedPipe_windows.go
|
| @@ -0,0 +1,30 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package streamclient
|
| +
|
| +import (
|
| + "errors"
|
| + "fmt"
|
| + "io"
|
| +
|
| + npipe "gopkg.in/natefinch/npipe.v2"
|
| +)
|
| +
|
| +// Register POSIX-only protocols.
|
| +func init() {
|
| + registerProtocol("net.pipe", newNamedPipeClient)
|
| +}
|
| +
|
| +// newNamedPipeClient creates a new Client instance bound to a named pipe stream
|
| +// server.
|
| +func newNamedPipeClient(path string) (Client, error) {
|
| + if path == "" {
|
| + return nil, errors.New("streamclient: cannot have empty named pipe path")
|
| + }
|
| +
|
| + return &clientImpl{func() (io.WriteCloser, error) {
|
| + return npipe.Dial(fmt.Sprintf(`\\.\pipe\%s`, path))
|
| + }}, nil
|
| +}
|
|
|