diff options
Diffstat (limited to 'test_msgnet')
-rw-r--r-- | test_msgnet/main.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test_msgnet/main.go b/test_msgnet/main.go index 66d7287..065b773 100644 --- a/test_msgnet/main.go +++ b/test_msgnet/main.go @@ -113,7 +113,7 @@ func connHandler(_conn *C.struct_msgnetwork_conn_t, connected C.bool, _ unsafe.P } else { fmt.Printf("[%s] Disconnected, retrying.\n", name) err := salticidae.NewError() - net.Connect(conn.GetAddr(), &err) + net.Connect(conn.GetAddr(), false, &err) } } @@ -127,20 +127,18 @@ func errorHandler(_err *C.struct_SalticidaeCError, fatal C.bool, _ unsafe.Pointe func genMyNet(ec salticidae.EventContext, name string, myAddr salticidae.NetAddr, otherAddr salticidae.NetAddr) MyNet { + err := salticidae.NewError() netconfig := salticidae.NewMsgNetworkConfig() - n := MyNet { - net: salticidae.NewMsgNetwork(ec, netconfig), - name: name, - } + net := salticidae.NewMsgNetwork(ec, netconfig, &err); checkError(&err) + n := MyNet { net: net, name: name } n.net.RegHandler(MSG_OPCODE_HELLO, salticidae.MsgNetworkMsgCallback(C.onReceiveHello), nil) n.net.RegHandler(MSG_OPCODE_ACK, salticidae.MsgNetworkMsgCallback(C.onReceiveAck), nil) n.net.RegConnHandler(salticidae.MsgNetworkConnCallback(C.connHandler), nil) n.net.RegErrorHandler(salticidae.MsgNetworkErrorCallback(C.errorHandler), nil) n.net.Start() - err := salticidae.NewError() n.net.Listen(myAddr, &err); checkError(&err) - n.net.Connect(otherAddr, &err); checkError(&err) + n.net.Connect(otherAddr, false, &err); checkError(&err) return n } |