-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Unix Socket On Linux #9
Conversation
@sv Could you review? |
abc7ed8
to
78cfa9c
Compare
kdb.go
Outdated
func DialUnix(host string, port int, auth string) (*KDBConn, error) { | ||
c, err := net.Dial("unix", "/tmp/kx."+fmt.Sprint(port)) | ||
// Connect to port using unix domain sockets. | ||
func DialUnix(port int, auth string) (*KDBConn, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please keep function signature unchanged. I am reviewing api for dialing at the moment and would like to minimise number of changes
kdb.go
Outdated
} else if runtime.GOOS == "darwin" { | ||
c, err = net.Dial("unix", fmt.Sprintf("/tmp/kx.%d", port)) | ||
} else { | ||
return nil, fmt.Errorf("kdb conn: unix socket is not supported on %s", runtime.GOOS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of fmt.Errorf please throw UnknownNetworkError("unix")
like here https://golang.org/src/net/unixsock.go#L59
e9acec1
to
5d28cb2
Compare
5d28cb2
to
66df15f
Compare
@sv Addressed comments |
On Linux, the DialUnix call fails. After investigating further, I realized that kdbq use @/tmp/kx.pid on Linux for Unix socket connection