Overview of Major Changes
The main breaking change between 3.4 and 4.0 is the introduction of new peer classes.
In Photon 3, there were two different classes of peers:
PeerBase: base class for any inbound connection with a Photon client.
ServerPeerBase: base class for any connection with a Photon server.
In Photon 4, those two classes should be replaced by their appropriate new substitute:
S2SPeerBase: base server-to-server class that replaces
InboundS2SPeer: should replace
ServerPeerBaseon the server accepting incoming connections.
OutboundS2SPeer: should replace
ServerPeerBaseon the server actively initiating connections.
To better handle disconnections and edge cases, base S2S class is split into two classes.
Photon Server A --> Photon Server B
In Server A, the recommended way is to use
OutboundS2SPeer. Server A actively initializes the connection. In Photon 3, to setup outgoing connections the method used was one of the
ApplicationBase.ConnectXXXfamily. Although this is still possible in v4, we do recommend switching to the new
OutboundS2SPeer.ConnectXXX. In fact, you no longer need to override the
ApplicationBase.CreateServerPeermethod. You can read more about S2S code in v4 in this update introduction here.
In Server B you should use
InboundS2SPeerServer B, listens and waits for incoming connection from Server A. That is why in
InoundS2SBasethe constructor has
|Photon v3||Photon v4||Type of peer|
||Any class that should communicate with a client on the other endpoint should extend from
||Any class that should setup an inbound connection with another Photon server should extend from
||The new and recommended way is to extend
||The old way of creating a class that should setup an outbound connection with another Photon server is to extend
License Updates and Upgrades
When upgrading to a new major version of the Photon SDK or when using an older SDK version with a newly purchased license file, you should make sure ahead of time before going into production, that your Photon SDK runs with that license.
The easiest way to do this is to put the license file in question into the Photon SDK folder you plan to use and start Photon via the Photon Control application. You should then check the license information shown in the tray app and additionally check the logs for licensing errors.