Commits

rmin...@gmail.com  committed 3478f77

Working with hierarchy, now for large scale testing. The stack stuff is working well.

But are the args for strcat backwards?

  • Participants
  • Parent commits c2515a2

Comments (0)

Files changed (4)

 	/* it is important to return the listen address, if this function was called
 	 * with port 0
 	 */
+	Dprint(2, "newListenProc %v %v\n", *defaultFam, srvaddr)
 	netl, err := net.Listen(*defaultFam, srvaddr)
 	if err != nil {
 		log.Fatal("newListenProc: ", err)
 
 
 func registerSlaves() os.Error {
-	l, err := Listen(*defaultFam, *myAddress)
+	l, err := Listen(*defaultFam, myListenAddress)
 	if err != nil {
 		log.Fatal("listen error:", err)
 	}
 package main
 
 import (
-	"fmt"
 	"os"
 	"strconv"
 	"strings"
  */
 func forth(c string) (string){
 	var stack Stack
-	fmt.Printf("FORTH: START>>>>>>>>>>>>>>>>\n") 
+	//fmt.Printf("FORTH: START>>>>>>>>>>>>>>>>\n") 
 	in := Stack(c)
-	fmt.Printf("in: %v\n", string(in))
+	//fmt.Printf("in: %v\n", string(in))
 	/* we won't use full tokenization yet because we're not sure we need it */
 	for len(string(in)) > 0 {
 		command := in.pop()
 				stack.push(command)
 			}
 		}
-		fmt.Printf("Op: %v; Stack: %v\n", command, string(stack))
+		//fmt.Printf("Op: %v; Stack: %v\n", command, string(stack))
 	}
-	fmt.Printf("FORTH: END>>>>>>>>>>>>>>>>%v\n", stack.tos())
+	//fmt.Printf("FORTH: END>>>>>>>>>>>>>>>>%v\n", stack.tos())
 	return stack.pop()
 }
 	cmdPort          = flag.String("cmdport", "6666", "command port")
 	defaultFam = flag.String("fam", "tcp4", "network type")
 	/* required in the command line */
-	parent           = flag.String("parent", "", "parent for some configurations")
-	myAddress = flag.String("myAddress", "", "Required set to my address")
-	myId = flag.String("myId", "", "Required -- tell slaves their id")
+	parent           = flag.String("parent", "hostname", "parent for some configurations")
+	myAddress = flag.String("myAddress", "hostname", "Required set to my address")
+	myId = flag.String("myId", "0", "Required -- tell slaves their id")
 	/* these are not switches */
 	role = "client"
+	myListenAddress string
 )
 
 /* 
 	*myAddress = forth(*myAddress)
 	*parent = forth(*parent)
 	fmt.Printf("My id is %v; parent %v; address %v\n", *myId, *parent, *myAddress)
+	myListenAddress = *myAddress + ":" + *cmdPort
 	log.SetPrefix("newgproc " + *prefix + ": ")
 	Dprintln(2, "starting:", os.Args, "debuglevel", *DebugLevel)
 
 	}
 	/* slight difference from master: we're ready when we start, since we run things */
 	vitalData := &vitalData{HostReady: true, Id: *myId}
+	masterAddr := *parent + ":" + *cmdPort
 	/* some simple sanity checking */
 	if *DoPrivateMount == true && os.Getuid() != 0 {
 		log.Fatal("Need to run as root for private mounts")
 	}
-	Dprint(2, "dialing masterAddr ", *parent)
-	master, err := Dial(*defaultFam, "", *parent)
+	Dprint(2, "dialing masterAddr ", masterAddr)
+	master, err := Dial(*defaultFam, "", masterAddr)
 	if err != nil {
 		log.Fatal("startSlave: dialing:", err)
 	}