V
V
Vanes Ri_Lax2015-10-23 09:25:25
C++ / C#
Vanes Ri_Lax, 2015-10-23 09:25:25

Why is the connection dropping?

Hello, I'm trying to connect to a server via web sockets.
I took the implementation class of the ws client itself here
I wrote a class that creates an instance of the ws client:

class WSClient
    {
        public static WebSocketWrapper wsServer  = WebSocketWrapper.Create("ws://127.0.0.1:3318");

        public WSClient()
        {
            wsServer.Connect();
           // wsServer.SendMessage("Привет сервер");
            
        }

    }

Further in my program, I write like this:
WSClient client = new WSClient();
As a result, the client connects to the server and immediately disconnects. But the program throws an exception:
Исключение типа "System.Net.WebSockets.WebSocketException" возникло в mscorlib.dll, но не было обработано в коде пользователя

Дополнительные сведения: Значение "Upgrade,Keep-Alive" заголовка "Connection" не является допустимым.

I have little experience in programming in c #, maybe I'm doing something wrong, please help me figure it out.
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VaneS Ri_Lax, 2015-10-23
@vanesxl

The question is removed, the solution to the issue is here
. Everything has been tested, everything works, the client normally connects to the server and waits for the server to send some data. Also, data is sent to the server normally, including Russian characters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question