Guaranteed package order with PUN and TCP?
Options
We are using PUN and the TCP protocol. Our game is turned based, where only one player is active at a time.
We use
Our question is it guaranteed is it that a message is received by a player and that packages are received in the right order?
Right now we're implementing a reconnect feature for disconnected players. The idea is for the Host to control whether to continue the game or wait for the disconnected player. Thus we need to make sure that all players receive the continue game message before anything else happens.
As a follow up, what are conditions for Photon to disconnect a player? I.e. has not heard from them in some time, packages are wildly out of order, etc.?
We use
PhotonNetwork.RaiseEvent(byte eventCode, object eventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)when sending messages and data between players. We're not caching and the SendOptions is set to SendOptions.SendReliable.
Our question is it guaranteed is it that a message is received by a player and that packages are received in the right order?
Right now we're implementing a reconnect feature for disconnected players. The idea is for the Host to control whether to continue the game or wait for the disconnected player. Thus we need to make sure that all players receive the continue game message before anything else happens.
As a follow up, what are conditions for Photon to disconnect a player? I.e. has not heard from them in some time, packages are wildly out of order, etc.?
0
Comments
-
As long as the sender and receiver are connected while the message is in transfer, yes, it is guaranteed that the reliable event is being received and in order.
In this case, order means: The order in which a sender sent the events. Assuming others send events at the exact same time, their RaiseEvent messages may arrive earlier or later on the server and get processed in either sequence.
For TCP, there is a timeout when the other side does not send anything for consecutive 10 seconds or if the TCP stack signals a lost connection. TCP itself does not have "out of order".1 -
You are right. The option to send reliable or not, only makes a difference when UDP clients are connected, too (even in a mix of TCP and UDP, this feature would work for the UDP side).1
-
Thanks for the answers and pointers!0