Tizen_4.0 base
[platform/upstream/docker-engine.git] / vendor / github.com / docker / swarmkit / xnet / xnet_unix.go
1 // +build !windows
2
3 package xnet
4
5 import (
6         "net"
7         "time"
8 )
9
10 // ListenLocal opens a local socket for control communication
11 func ListenLocal(socket string) (net.Listener, error) {
12         // on unix it's just a unix socket
13         return net.Listen("unix", socket)
14 }
15
16 // DialTimeoutLocal is a DialTimeout function for local sockets
17 func DialTimeoutLocal(socket string, timeout time.Duration) (net.Conn, error) {
18         // on unix, we dial a unix socket
19         return net.DialTimeout("unix", socket, timeout)
20 }