overflow_probe_container/client/socket_builders_windows.go
crusader 87b8c60cd9 ing
2017-12-05 14:20:42 +09:00

24 lines
478 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(network, address string) (net.Conn, error) {
if 0 == sb.HandshakeTimeout {
return npipe.Dial(`\\.\pipe\` + address)
}
return npipe.DialTimeout(`\\.\pipe\`+address, sb.HandshakeTimeout)
}