Skip to content
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

Merged
merged 1 commit into from
Oct 3, 2018
Merged

Fix Unix Socket On Linux #9

merged 1 commit into from
Oct 3, 2018

Conversation

yznima
Copy link
Contributor

@yznima yznima commented Oct 3, 2018

On Linux, the DialUnix call fails. After investigating further, I realized that kdbq use @/tmp/kx.pid on Linux for Unix socket connection

@yznima
Copy link
Contributor Author

yznima commented Oct 3, 2018

@sv Could you review?

@yznima yznima force-pushed the ffix-unix-linux branch 2 times, most recently from abc7ed8 to 78cfa9c Compare October 3, 2018 05:11
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) {
Copy link
Owner

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)
Copy link
Owner

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

@yznima yznima force-pushed the ffix-unix-linux branch 2 times, most recently from e9acec1 to 5d28cb2 Compare October 3, 2018 14:34
@yznima
Copy link
Contributor Author

yznima commented Oct 3, 2018

@sv Addressed comments

@sv sv merged commit 4301bb8 into sv:master Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants