Skip to content

Commit

Permalink
[win pipes] Defer connection establishment to first write
Browse files Browse the repository at this point in the history
Allows the client creation call (`New`) call with a windows named pipe
target address to be successful even if the Agent hasn't created the
named pipe yet. This new behavior is consistent with the UDS writer.
  • Loading branch information
olivielpeau authored and hush-hush committed Mar 15, 2021
1 parent 75ff597 commit c995f1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions statsd/pipe_windows.go
Expand Up @@ -75,10 +75,10 @@ func (p *pipeWriter) Close() error {
}

func newWindowsPipeWriter(pipepath string) (*pipeWriter, error) {
conn, err := winio.DialPipe(pipepath, nil)
// Defer connection establishment to first write
return &pipeWriter{
conn: conn,
conn: nil,
timeout: defaultPipeTimeout,
pipepath: pipepath,
}, err
}, nil
}

0 comments on commit c995f1b

Please sign in to comment.