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 committed Mar 15, 2021
1 parent 75ff597 commit 5ec4fcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statsd/pipe_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ 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
Expand Down

0 comments on commit 5ec4fcc

Please sign in to comment.