From 66914cd88bd822d3399e754f43a42906c043f1fd Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 22 Jun 2019 01:45:37 -0400 Subject: support TLS; change some API --- test_msgnet/main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'test_msgnet/main.go') 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 } -- cgit v1.2.3-70-g09d2