Commits

jtdreisb committed b3dfd4b

force tcp for Run ioproxy. If will fail on the dial rather than the typecast if the family is incorrect.

  • Participants
  • Parent commits d52811f

Comments (0)

Files changed (2)

File ioproxy/ioproxy.go

 }
 
 func (ip *Ioproxy) Run(path string, args []string, env []string, wd string) (err os.Error) {
-	c, err := net.Dial(ip.Fam(), "", ip.Addr())
+	ra, err := net.ResolveTCPAddr(ip.Addr())
+	c, err := net.DialTCP(ip.Fam(), nil, ra)
 	if err != nil {
-		return
+		return 
 	}
-	// "#$%"#%"%" this has to be tcp to use File()
-	// I need to use exec.Run here. 
-	// I can't, so how am I going to do this?
-	// just wait for the ioproxy.
-	n, ok := c.(*net.TCPConn)
-	if !ok {
-		return os.NewError("io proxies must connect via tcp")
+	file, err := c.File()
+	if err != nil { 
+		return 
 	}
-	file, err := n.File()
 	f := []*os.File{file, file, file}
 	_, err = os.ForkExec(path, args, env, wd, f)
 	//	n.Close() // closing doesn't do what you expect here.

File worker/rpc.go

 	"bitbucket.org/npe/cluster/fileset"
 	"bitbucket.org/npe/cluster/locale"
 	"bitbucket.org/npe/cluster/nrange"
-
 	"os"
 )