xnet_unix.go 483 B

1234567891011121314151617181920
  1. // +build !windows
  2. package xnet
  3. import (
  4. "net"
  5. "time"
  6. )
  7. // ListenLocal opens a local socket for control communication
  8. func ListenLocal(socket string) (net.Listener, error) {
  9. // on unix it's just a unix socket
  10. return net.Listen("unix", socket)
  11. }
  12. // DialTimeoutLocal is a DialTimeout function for local sockets
  13. func DialTimeoutLocal(socket string, timeout time.Duration) (net.Conn, error) {
  14. // on unix, we dial a unix socket
  15. return net.DialTimeout("unix", socket, timeout)
  16. }