LaodBalancing WebSocket

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

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

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

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.
Best
Vincent

Comments

  • vmarquis
    vmarquis
    edited August 2015
    Hello,
    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";
    Client.Connect();

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

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

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

    Best
    Vincent
  • Does someone have any idea?
    Tobias?
    Best
  • 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
    vmarquis
    edited September 2015
    Hi,
    Photon-Unity3D-Sdk_v4-0-0-10
    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.
    Best
  • 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?
    Best
  • 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 http://forum.photonengine.com/discussion/6586/webgl-unity-5-secure-websocket-self-hosted-not-working
    Best