Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Exception: unknown server protocol version #24

Open
DrewRidley opened this issue Mar 10, 2019 · 2 comments
Open

System.Exception: unknown server protocol version #24

DrewRidley opened this issue Mar 10, 2019 · 2 comments

Comments

@DrewRidley
Copy link

DrewRidley commented Mar 10, 2019

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!

@zacharygriffee
Copy link

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!

@janusw
Copy link
Contributor

janusw commented Feb 27, 2021

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://").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants