|
|
|
@ -20,7 +20,8 @@ var ( |
|
|
|
|
func SocketClient(addr string) { |
|
|
|
|
conn, err := net.Dial("tcp", addr) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatalln(err) |
|
|
|
|
log.Println(err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
|
@ -43,10 +44,6 @@ func main() { |
|
|
|
|
for _, config := range configs { |
|
|
|
|
ip := config[0] |
|
|
|
|
port := "1" + config[1] // the port number of solider is "1" + node port
|
|
|
|
|
duty := config[2] |
|
|
|
|
if duty == "client" { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
addr := strings.Join([]string{ip, port}, ":") |
|
|
|
|
SocketClient(addr) |
|
|
|
|
} |
|
|
|
|