From d57710e28eb2d609225b8b625837c409da75ef25 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 15 Dec 2017 16:34:12 +0900 Subject: [PATCH] ing --- client/socket_builders.go | 4 +++- client/socket_builders_unix.go | 9 --------- client/socket_builders_windows.go | 22 ---------------------- 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 client/socket_builders_unix.go delete mode 100644 client/socket_builders_windows.go diff --git a/client/socket_builders.go b/client/socket_builders.go index fe5ffe2..12f3f68 100644 --- a/client/socket_builders.go +++ b/client/socket_builders.go @@ -5,7 +5,9 @@ import ( ) func NewSocketBuilder(address string, socketHandler csc.SocketHandler) csc.SocketBuilder { - sb := newSocketBuilder(address) + sb := &SocketBuilders{} + sb.Network = "tcp" + sb.Address = address sb.SocketHandler = socketHandler return sb } diff --git a/client/socket_builders_unix.go b/client/socket_builders_unix.go deleted file mode 100644 index 592f15d..0000000 --- a/client/socket_builders_unix.go +++ /dev/null @@ -1,9 +0,0 @@ -package client - -func newSocketBuilder(address string) *SocketBuilders { - sb := &SocketBuilders{} - sb.Network = "unix" - sb.Address = address - - return sb -} diff --git a/client/socket_builders_windows.go b/client/socket_builders_windows.go deleted file mode 100644 index eb31348..0000000 --- a/client/socket_builders_windows.go +++ /dev/null @@ -1,22 +0,0 @@ -package client - -import ( - "net" - - "gopkg.in/natefinch/npipe.v2" -) - -func newSocketBuilder(address string) *SocketBuilders { - sb := &SocketBuilders{} - sb.Network = "pipe" - sb.Address = address - - return sb -} - -func (sb *SocketBuilders) Dial(network, address string) (net.Conn, error) { - if 0 == sb.HandshakeTimeout { - return npipe.Dial(`\\.\pipe\` + address) - } - return npipe.DialTimeout(`\\.\pipe\`+address, sb.HandshakeTimeout) -}