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

Side by Side Diff: client/internal/logdog/butler/streamserver/npipe_windows.go

Issue 1429993002: LogDog: Add Butler stream server package. (Closed) Base URL: https://github.com/luci/luci-go@logdog-review-butlerproto
Patch Set: Cleanup, comments. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package streamserver
6
7 import (
8 "fmt"
9 "net"
10
11 log "github.com/luci/luci-go/common/logging"
12 "golang.org/x/net/context"
13 "gopkg.in/natefinch/npipe.v2"
14 )
15
16 type namedPipeServer struct {
17 namedPipeServerBase
18
19 address string // The address of the Windows socket to create
20 }
21
22 // NewNamedPipeServer instantiates a new POSIX named pipe server instance.
iannucci 2015/11/12 22:44:24 POSIX?
dnj 2015/11/13 20:17:15 Done.
23 func NewNamedPipeServer(ctx context.Context, address string) StreamServer {
24 s := &namedPipeServer{
25 address: address,
26 }
27 ctx = log.SetField(ctx, "address", address)
28 s.initBase(ctx)
29 return s
30 }
31
32 func (s *namedPipeServer) String() string {
33 return fmt.Sprintf("NamedPipeServer[%s]", s.address)
iannucci 2015/11/12 22:44:24 we should distinguish these String()'s by somethin
dnj 2015/11/13 20:17:15 This was before logging, so I remove this altogeth
34 }
35
36 // Wrapper around the "unix"-type Listener that cleans up the named pipe on
37 // creation and 'Close()'
38 type selfCleaningUNIXListener struct {
39 path string
40 listener net.Listener
41 }
42
43 // OS-specific override to create a UNIX named socket listener
44 func (s *namedPipeServer) createListener() (net.Listener, error) {
45 log.Debugf(s.ctx, "Creating Windows server socket Listener.")
46 return npipe.Listen(s.address)
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698