sacOO7 / SocketclusterClientDotNet

C# client for socketcluster framework in node.js

Home Page:http://socketcluster.io/#!/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System.Exception: unknown server protocol version

DrewRidley opened this issue · comments

On Xamarian.Forms, I received the following exception.

System.Exception: unknown server protocol version

    void IBasicListener.OnConnectError(Socket socket, ErrorEventArgs e)
    {
        System.Diagnostics.Debug.WriteLine("Connection Error : " + e.Exception.ToString());
    }

    protected override void OnStart()
    {
        conn = new Socket("ws://73.159.237.174:8000");
        conn.SetListerner(new App());
        conn.SetReconnectStrategy(new ReconnectStrategy().SetMaxAttempts(10));
        conn.Connect();
    }

The issue appears to be WebSocket related, which leads me to believe it may have something to do with an exception within SocketClusterClient itself, rather than my specific application. Thanks,

Drew.

UPDATE:
kerryjiang/WebSocket4Net#8
This issue seems related, so I believe you have to pass the origin into WebSocket4Net. If someone could take on this task, and bring this project back to its original potential, we would all greatly appreciate that. Thanks!

Realize this is an old issue, but I ran into this very issue. What fixed it for me is putting a slash at the end of the URI:

conn = new Socket("ws://73.159.237.174:8000/");

and if there is a path to the socketcluster, for me it is 'gs':

ws://127.0.0.1:8000/gs/

Hope this is helpful!

I have also been running into this occasionally (with version 1.1.2), but could never figure out under which circumstances it occurs (and have not been able to find a clean reproducer).

Note: I do have a slash at the end of the URI, and in fact I use a secure websocket connection ("wss://").