Skip to content

Instantly share code, notes, and snippets.

@ailabs-software
Created January 6, 2015 16:34
Show Gist options
  • Select an option

  • Save ailabs-software/220b92f9035e49ac0bef to your computer and use it in GitHub Desktop.

Select an option

Save ailabs-software/220b92f9035e49ac0bef to your computer and use it in GitHub Desktop.
Trying to create a listener I can pass to the worker.
func startWorker() {
cmd := exec.Command("myworker");
f, err := os.Create("/tmp/worker7.sock");
if (err != nil) { panic(err); }
_, file_err := net.FileListener(f); // ERROR: getsockopt: socket operation on non-socket
if (file_err != nil) { panic(file_err); }
cmd.ExtraFiles = []*os.File{ f };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment