|
|
|
@ -75,6 +75,11 @@ func dictateNodes(command string) { |
|
|
|
|
port := "1" + config[1] // the port number of solider is "1" + node port
|
|
|
|
|
addr := strings.Join([]string{ip, port}, ":") |
|
|
|
|
|
|
|
|
|
go dictateNode(addr, command) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func dictateNode(addr string, command string) { |
|
|
|
|
// creates client
|
|
|
|
|
conn, err := net.Dial("tcp", addr) |
|
|
|
|
if err != nil { |
|
|
|
@ -95,7 +100,6 @@ func dictateNodes(command string) { |
|
|
|
|
buff := make([]byte, 1024) |
|
|
|
|
n, _ := conn.Read(buff) |
|
|
|
|
log.Printf("Receive from %s: %s", addr, buff[:n]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func hostConfigFile() { |
|
|
|
|