Photon C++ Client API: Using TCP

Photon C++ Client API

Photon C++ Client API  4.1.12.2
Using TCP

A PhotonPeer could be instanced with TCP as underlying protocol if necessary. This is not best practice but some client platforms and some clouds don't support UDP sockets and some end users' firewall or router settings may not allow it. However UDP is the preferable protocol for Photon, whenever you have the choice.

The Photon Client API is the same for both protocols but there are some differences in what goes on under the hood.

Everything sent over TCP is always reliable, even if you call your operations as unreliable!

If you use only TCP clients Simply send any operation unreliable. It saves some work (and bandwidth) in the underlying protocols.

If you have TCP and UDP clients
Anything you send between the TCP clients will always be transferred reliable. But as you communicate with some clients that use UDP these will get your events reliable or unreliable according to your specifications.

Example: A client, which has been initialized to use TCP, might send unreliable movement updates in channel 1. These will be sent via TCP, which makes it reliable. Photon however also has connections with UDP clients. It will use your reliable / unreliable settings to forward your movement updates accordingly.