From 9af95694330d8d0a56f534509e98dbac8e89e85e Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 7 Jun 2019 22:36:19 -0400 Subject: ... --- salticidae | 2 +- test_msgnet/main.go | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/salticidae b/salticidae index f7050c1..0f3b3ed 160000 --- a/salticidae +++ b/salticidae @@ -1 +1 @@ -Subproject commit f7050c145e81a70be85bb0287044abdfa7ba444f +Subproject commit 0f3b3ed832db7062c805e82a9605b777595e340c diff --git a/test_msgnet/main.go b/test_msgnet/main.go index a92556f..b768adf 100644 --- a/test_msgnet/main.go +++ b/test_msgnet/main.go @@ -9,7 +9,6 @@ package main import "C" import ( - "unsafe" "encoding/binary" "fmt" "salticidae-go" @@ -130,13 +129,13 @@ func main() { alice = genMyNet(ec, "Alice") bob = genMyNet(ec, "Bob") - alice.net.RegHandler(MSG_OPCODE_HELLO, salticidae.MsgNetworkMsgCallback(unsafe.Pointer(C.onReceiveHello))) - alice.net.RegHandler(MSG_OPCODE_ACK, salticidae.MsgNetworkMsgCallback(unsafe.Pointer(C.onReceiveAck))) - alice.net.RegConnHandler(salticidae.MsgNetworkConnCallback(unsafe.Pointer(C.connHandler))) + alice.net.RegHandler(MSG_OPCODE_HELLO, salticidae.MsgNetworkMsgCallback(C.onReceiveHello)) + alice.net.RegHandler(MSG_OPCODE_ACK, salticidae.MsgNetworkMsgCallback(C.onReceiveAck)) + alice.net.RegConnHandler(salticidae.MsgNetworkConnCallback(C.connHandler)) - bob.net.RegHandler(MSG_OPCODE_HELLO, salticidae.MsgNetworkMsgCallback(unsafe.Pointer(C.onReceiveHello))) - bob.net.RegHandler(MSG_OPCODE_ACK, salticidae.MsgNetworkMsgCallback(unsafe.Pointer(C.onReceiveAck))) - bob.net.RegConnHandler(salticidae.MsgNetworkConnCallback(unsafe.Pointer(C.connHandler))) + bob.net.RegHandler(MSG_OPCODE_HELLO, salticidae.MsgNetworkMsgCallback(C.onReceiveHello)) + bob.net.RegHandler(MSG_OPCODE_ACK, salticidae.MsgNetworkMsgCallback(C.onReceiveAck)) + bob.net.RegConnHandler(salticidae.MsgNetworkConnCallback(C.connHandler)) alice.net.Start() bob.net.Start() @@ -150,9 +149,9 @@ func main() { alice_addr.Free() bob_addr.Free() - ev_int := salticidae.NewSigEvent(ec, salticidae.SigEventCallback(unsafe.Pointer(C.onTerm))) + ev_int := salticidae.NewSigEvent(ec, salticidae.SigEventCallback(C.onTerm)) ev_int.Add(salticidae.SIGINT) - ev_term := salticidae.NewSigEvent(ec, salticidae.SigEventCallback(unsafe.Pointer(C.onTerm))) + ev_term := salticidae.NewSigEvent(ec, salticidae.SigEventCallback(C.onTerm)) ev_term.Add(salticidae.SIGTERM) ec.Dispatch() -- cgit v1.2.3-70-g09d2