Added Dialer stub

pull/1019/head
Shelikhoo 7 years ago
parent 8fe53261cc
commit b9dddd0586
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

@ -1,7 +1,19 @@
package domainsocket
import "context"
import (
"context"
"net"
)
func DialDS(ctx context.Context, path string) {
func DialDS(ctx context.Context, path string) (*net.UnixConn, error) {
resolvedAddress, err := net.ResolveUnixAddr("unixpacket", path)
if err != nil {
return nil, err
}
dialedUnix, err := net.DialUnix("unixpacket", nil, resolvedAddress)
if err != nil {
return nil, err
}
return dialedUnix, nil
}

Loading…
Cancel
Save