Added function Stub

This commit is contained in:
Shelikhoo
2018-02-12 14:09:12 +08:00
parent a6612a2baa
commit 8fe53261cc
2 changed files with 28 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
package domainsocket
import "context"
func DialDS(ctx context.Context, path string) {
}
@@ -1 +1,22 @@
package domainsocket
import (
"context"
"net"
)
type Listener struct {
ln net.Listener
}
func ListenDS(ctx context.Context, path string) (*Listener, error) {
addr := new(net.UnixAddr)
addr.Name = path
addr.Net = "unixpacket"
li, err := net.ListenUnix("unixpacket", addr)
if err != nil {
return nil, err
}
vln := &Listener{ln: li}
return vln, nil
}