Photon Voice & TCP client

I'm developing an application that has a voice chat and receive data from a server via TCP socket.
I've made a simple application using System.Net.Sockets and works well.. but when I use it in the Photon Voice app (connected to Photon Server), the Photon Voice works but the client/server communication doesn't work. Why? Conflicts?
Any suggestions to solve this problem?


  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @StyleMaster,

    Thank you for choosing Photon!

    I did not understand your issue.

    Do you use Photon Voice (PUNVoice package from Unity's asset store) with self-hosted Photon Server?
    Currently, TCP is not available by default for Photon Voice. While we do not officially support it, I can give you a workaround to make it work.

    Do you want to use Photon Voice in a .Net app outside Unity?
  • @JohnTube can you post the workaround? I have the same issue as OP and would be grateful to have a fix for it. I need to run Photon Voice on a TCP socket.
  • Can you explain what is the exact issue and why udp does not work for you? We can add udp/tcp option in next Photon Voice release if it makes sense.
    Probably Hamza meant replacing Udp to Tcp in PhotonVoiceNetwork.cs's line
    client = new UnityVoiceFrontend(ConnectionProtocol.Udp);
  • Thank you @vadim for the response. It's the same issue that others have had where the network we're on (University or Corporate) doesn't allow UDP.

    If I implement the suggested change, what TCP port would I use for the voice?
  • The port is the same as for PUN TCP: 4533
    I think it's set automatically.
  • Hi guys
    Now is it possible to connect to self hosted photon server with TCP protocol if you use Photon Voice?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Grigor,

    Thank you for choosing Photon and sorry for my late reply I missed your comment.
    Yes, Photon Voice 1 works with self-hosted Photon Server using TCP or UDP but not WSS (WebSocketsSecure) or WS (WebSockets).
    Photon Voice 2 will also work in 2.1 that will be released soon.