@yosh I think my issue is that I am trying to reuse it both in a closure and later in some other code.
I think I just need to rewrite this using channels and treat the two simulated peers as fully separate peers + have them listen on incoming events generated from a third thread doing the networking.