From b9dddd0586ff44989e9e692e45aa0110179e3033 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Wed, 22 Nov 2017 21:53:22 +0800 Subject: [PATCH] Added Dialer stub --- transport/internet/domainsocket/dial.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/transport/internet/domainsocket/dial.go b/transport/internet/domainsocket/dial.go index 99d34ccb..0c2174cd 100644 --- a/transport/internet/domainsocket/dial.go +++ b/transport/internet/domainsocket/dial.go @@ -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 }