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

Unified Diff: client/internal/logdog/butler/streamserver/namedPipe_windows.go

Issue 1429993002: LogDog: Add Butler stream server package. (Closed) Base URL: https://github.com/luci/luci-go@logdog-review-butlerproto
Patch Set: Bind POSIX test to POSIX domains. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: client/internal/logdog/butler/streamserver/namedPipe_windows.go
diff --git a/client/internal/logdog/butler/streamserver/namedPipe_windows.go b/client/internal/logdog/butler/streamserver/namedPipe_windows.go
new file mode 100644
index 0000000000000000000000000000000000000000..ea6667235764203cd1001e15086fe73a12231712
--- /dev/null
+++ b/client/internal/logdog/butler/streamserver/namedPipe_windows.go
@@ -0,0 +1,22 @@
+// 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 streamserver
+
+import (
+ "net"
+
+ log "github.com/luci/luci-go/common/logging"
+ "golang.org/x/net/context"
+ npipe "gopkg.in/natefinch/npipe.v2"
+)
+
+// NewNamedPipeServer instantiates a new Windows named pipe server instance.
+func NewNamedPipeServer(ctx context.Context, address string) StreamServer {
+ ctx = log.SetField(ctx, "address", address)
+ return createNamedPipeServer(ctx, func() (net.Listener, error) {
+ log.Debugf(ctx, "Creating Windows server socket Listener.")
+ return npipe.Listen(address)
+ })
+}

Powered by Google App Engine
This is Rietveld 408576698