Closed AlekSi closed 8 years ago
That's because the Transmitter part of the Transceiver is the same, but the Receiver part of the Transceiver is not - it has to share the same inflight to multiplex i/o messages.
Instead of initializing the random source on both, you could do a lazy initialization only in the Transmitter's Bind by using sync.Once.
Haven't had time to review this yet. Any input from others is appreciated.
Aside: The code in
Bind()
methods seems to be a copy&paste. I don't really understand why there isAddr
,User
, etc. inTransceiver
and embeddedTransmitter
with the same fields. That's something I would refactor in my code. But maybe I don't understand it all.