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

Remove the unix file before listening if the server is running as unix server #32

Closed
hwchiu opened this issue Jun 11, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@hwchiu
Copy link
Contributor

hwchiu commented Jun 11, 2018

No description provided.

@hwchiu hwchiu added the enhancement New feature or request label Jun 11, 2018
@John-Lin
Copy link
Contributor

John-Lin commented Jun 11, 2018

We should unlink before bind and follow UNIX principle. see simple UDS server example in C.

https://github.com/troydhanson/network/blob/master/unixdomain/01.basic/srv.c#L28-L29

https://troydhanson.github.io/network/Unix_domain_sockets.html#unlink-before-bind

err = syscall.Unlink(socketpath)
if err != nil {
    // not really important if it fails
    log.Error("Unlink()",err)
}

log.Println("Starting gRPC server")
ln, err := net.Listen("unix", "/tmp/go.sock")

sufuf3 added a commit that referenced this issue Jun 12, 2018
Unlink before start grpc newserver, if the server is running as unix
server. close #32
@hwchiu hwchiu closed this as completed in fba1cc9 Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants