aboutsummaryrefslogtreecommitdiff
path: root/bench_network
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-07-02 01:06:59 -0400
committerDeterminant <[email protected]>2019-07-02 01:06:59 -0400
commitb962e27a59c8fe49c95c6515577ce89898d9ae65 (patch)
tree993fabfb4299b3668c7933ea33f08bc85ca0af6b /bench_network
parentbbe214128b6f7cb4e57fcda7adc3205ec9ec66cb (diff)
update API
Diffstat (limited to 'bench_network')
-rw-r--r--bench_network/main.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/bench_network/main.go b/bench_network/main.go
index fc46ea0..d7d0925 100644
--- a/bench_network/main.go
+++ b/bench_network/main.go
@@ -98,15 +98,14 @@ func connHandler(_conn *C.struct_msgnetwork_conn_t, connected C.bool, userdata u
if connected {
if conn.GetMode() == salticidae.CONN_MODE_ACTIVE {
fmt.Printf("[%s] connected, sending hello.\n", mynet.name)
- mynet.conn = conn.Copy()
+ mynet.conn = conn.Copy(true)
mynet.tcall.AsyncCall(salticidae.ThreadCallCallback(C.onTrigger), userdata)
} else {
fmt.Printf("[%s] passively connected, waiting for greetings.\n", mynet.name)
}
} else {
fmt.Printf("[%s] disconnected, retrying.\n", mynet.name)
- err := salticidae.NewError()
- mynet.net.Connect(conn.GetAddr(), false, &err)
+ mynet.net.Connect(conn.GetAddr())
}
return true
}
@@ -150,8 +149,7 @@ func main() {
ec = salticidae.NewEventContext()
err := salticidae.NewError()
- aliceAddr := salticidae.NewAddrFromIPPortString("127.0.0.1:12345", &err)
- //bobAddr := salticidae.NewAddrFromIPPortString("127.0.0.1:12346", &err)
+ aliceAddr := salticidae.NewNetAddrFromIPPortString("127.0.0.1:12345", true, &err)
mynets = append(mynets, genMyNet(ec, "alice", 10, 0))
alice := &mynets[0]
@@ -165,7 +163,7 @@ func main() {
go func() {
bob := &mynets[1]
bob.net.Start()
- bob.net.Connect(aliceAddr, false, &err); checkError(&err)
+ bob.net.Connect(aliceAddr)
tec.Dispatch()
bobThread <-struct{}{}
}()