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) -}