Disconnect v.s. peer.RequestFiber.Enqueue(peer.Disconnect);
Options
caozane
✭
When explicitly disconnecting a peer should I use:
peer.RequestFiber.Enqueue(peer.Disconnect);
or
peer.Disconnect();
?
peer.RequestFiber.Enqueue(peer.Disconnect);
or
peer.Disconnect();
?
0
Comments
-
Both options are possible. Everything that is enqueued on the RequestFiber is executed "in order" on the same thread.
So if you want to disconnect immediately - simply use peer.Disconnect()
If you want to disconnect, but only after the fiber has executed all actions that had been enqueued previously - go with "peer.RequestFiber.Enqueue(peer.Disconnect);".0