mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-25 08:09:07 +02:00
18 lines
429 B
Go
18 lines
429 B
Go
//go:build windows
|
|
|
|
package server
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
// isPipeDisconnect reports the named-pipe errors a client that closed its end
|
|
// produces: the pipe is being closed, has ended, or was never connected.
|
|
func isPipeDisconnect(err error) bool {
|
|
return errors.Is(err, windows.ERROR_NO_DATA) ||
|
|
errors.Is(err, windows.ERROR_BROKEN_PIPE) ||
|
|
errors.Is(err, windows.ERROR_PIPE_NOT_CONNECTED)
|
|
}
|