Disconnect v.s. peer.RequestFiber.Enqueue(peer.Disconnect);

Options
caozane
caozane
edited September 2013 in Photon Server
When explicitly disconnecting a peer should I use:
peer.RequestFiber.Enqueue(peer.Disconnect);
or
peer.Disconnect();
?

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);".