LaodBalancing WebSocket

Thank for releasing WebSocket for Unity Client
I think I found a bug.
public LoadBalancingClient(ConnectionProtocol protocol = ConnectionProtocol.Udp)
UnityEngine.Debug.Log("LoadBalancingClient using a new WebSocket LoadBalancingPeer and SocketWebTcp.");
protocol = ConnectionProtocol.WebSocketSecure;

this.loadBalancingPeer = new LoadBalancingPeer(this, protocol);

if (protocol == ConnectionProtocol.WebSocket || protocol == ConnectionProtocol.WebSocketSecure) {
this.loadBalancingPeer.SocketImplementation = typeof(SocketWebTcp);

this.loadBalancingPeer.SocketImplementation = typeof(SocketWebTcp); The class SocketWebTcp is unknown.
I made search I think this class exist in PUN but not in Unity SDK.


  • vmarquis
    edited August 2015
    I add SocketWebTcp.cs, WebSocket.cs and websocket-sharp.dll that i took in PUN.

    But now I can't connect
    I have statusCode=ExceptionOnConnect in OnStatusChanged(StatusCode statusCode)

    In client to connect I make
    Client.MasterServerAddress = "ws://localhost:9090";

    My server is a loadbalancing with Photon-OnPremise-Server-SDK_v3-4-30-9719.

    When i exec netstat -a -b
    I have: TCP VIncent-Main:0 LISTENING [PhotonSocketServer.exe]

    When I try to connect nothing is write in server logs.

  • Does someone have any idea?
  • Hi,

    As far as I know there is no official support for websockets in current dotnet Photon SDK.
    What version of SDK do you use?
  • vmarquis
    edited September 2015
    According to release_history.txt, web socket have been release in this version.
    The release note say:
    Fixed: Unity library SocketWebTcp class for websocket support. It requires a coroutine on a new GameObject which is now marked as DontDestroyOnLoad(go) and survives scene loading.
    But i don't found SocketWebTcp class.
  • This line is about websocket fix in Photon Unity Networking plugin which partly shares codebase with dotnet Photon SDK. Not sure if it was included in release notes intentionally or by mistake.
    When websocket support will be added, it will be explicitly stated in release notes.
  • Hi
    And have you got an idea for the date of websocket support release?
  • Hi,

    Sorry, we do not have concrete date for release yet.

    After adding SocketWebTcp.cs and WebSocket folder from PUN to Unity SDK installation, websockets work for me when connecting to Photon Cloud. I believe you did the same but with Photon Server. So maybe problem is in the server. I will update after getting more info on this from server team.
    Can you try to connect to the cloud to test if you modified client properly?
  • Current Photon Server v3 does not support websockets. Only upcoming v4 does.
  • Correct i connect well to Photon Cloud.
    In the server log i have 2 line who appears after few seconds:
    2015-09-12 08:42:32,787 [14] WARN Photon.SocketServer.Protocol [(null)] - Subprotocol GpBinaryV16 is unknown
    2015-09-12 08:42:32,789 [14] WARN Photon.SocketServer.ApplicationBase [(null)] - OnInit - Failed to parse init request for WebSocket peer: {0}System.Byte[]
    There an other thread relate to the same problème