22 lines
417 B
Go
22 lines
417 B
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"net"
|
||
|
|
||
|
csc "git.loafle.net/commons_go/server/client"
|
||
|
"gopkg.in/natefinch/npipe.v2"
|
||
|
)
|
||
|
|
||
|
func newSocketBuilder(address string) csc.SocketBuilder {
|
||
|
sb := &SocketBuilders{}
|
||
|
sb.Network = "pipe"
|
||
|
sb.Address = address
|
||
|
|
||
|
return sb
|
||
|
}
|
||
|
|
||
|
func (sb *SocketBuilders) Dial(dialer *net.Dialer, network, address string) (net.Conn, error) {
|
||
|
|
||
|
return npipe.DialTimeout(`\\.\pipe\`+address, dialer.Timeout)
|
||
|
}
|