github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/juju/sockets/sockets_windows.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package sockets
     5  
     6  import (
     7  	"net"
     8  	"net/rpc"
     9  
    10  	"github.com/juju/errors"
    11  
    12  	"gopkg.in/natefinch/npipe.v2"
    13  )
    14  
    15  func Dial(socketPath string) (*rpc.Client, error) {
    16  	conn, err := npipe.Dial(socketPath)
    17  	return rpc.NewClient(conn), errors.Trace(err)
    18  }
    19  
    20  func Listen(socketPath string) (net.Listener, error) {
    21  	listener, err := npipe.Listen(socketPath)
    22  	return listener, errors.Trace(err)
    23  }