TCP Photon Voice Connection

Options
Hello,

I need some information about photon voice. It does not work in network while the same scene works in 2 connections in 4g and also at me in wired connection. I need it in TCP with the network of my company which I think will be difficult to configure in terms of port...

Knowing that a Realtime session in TCP works correctly regardless of its location.

The error message:
SocketUdp.Disconnect()
UnityEngine.Debug:Log(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2130)
ExitGames.Client.Photon.<>c__DisplayClass104_0:<EnqueueDebugReturn>b__0() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:923)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:431)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1598)
Photon.Voice.Unity.VoiceConnection:Dispatch() (at Assets/Photon/PhotonVoice/Code/VoiceConnection.cs:428)
Photon.Voice.Unity.VoiceConnection:FixedUpdate() (at Assets/Photon/PhotonVoice/Code/VoiceConnection.cs:411)

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @kylsar,

    Thank you for choosing Photon!

    Photon Voice works best using UDP like all streaming applications.
    This is why, by default, we automatically force protocol used to UDP when connecting to Photon Cloud.

    However, since Photon Voice is built on top of Photon Realtime and uses the same servers, you could change the protocol like this:

    In latest version, in VoiceConnection.ConnectUsingSettings:

    replace:
    if (Settings.Protocol == ConnectionProtocol.Tcp)
                {
                    if (!Settings.IsMasterServerAddress)
                    {
                        if (this.Logger.IsWarningEnabled)
                        {
                            this.Logger.LogWarning("Requested protocol not supported on Photon Cloud {0}. Switched to UDP.", Settings.Protocol);
                        }
                        this.Client.LoadBalancingPeer.TransportProtocol = ConnectionProtocol.Udp;
                    }
                    else
                    {
                        this.Client.LoadBalancingPeer.TransportProtocol = ConnectionProtocol.Tcp;
                    }
                }
                else if (Settings.Protocol != ConnectionProtocol.Udp)
                {
                    if (this.Logger.IsWarningEnabled)
                    {
                        this.Logger.LogWarning("Requested protocol not supported: {0}. Switched to UDP.", Settings.Protocol);
                    }
                    this.Client.LoadBalancingPeer.TransportProtocol = ConnectionProtocol.Udp;
                }
    

    with:
    this.Client.LoadBalancingPeer.TransportProtocol = Settings.Protocol;
    

    And don't forget to set the protocol from the AppSettings.
  • kylsar
    Options
    It's working, thanks you !