U
U
Untiwe2022-02-09 20:59:38
C++ / C#
Untiwe, 2022-02-09 20:59:38

How to send message to client in Socket.Stream?

There is an application in C # to which you need to attach a web interface with a minimum response time (several timers are displayed), so I want to implement a socket connection. Mozilla has a great example, just for me. It already shows the connection, handshake and reading a message from the client. Bonus, the JS side is shown. It just doesn't show how to compose a response to the client. The next page shows what bytes the message is from, but I still can't compose it correctly.
Whenever you try to send something to the client, the connection is immediately terminated, even if you send the same byte array that came.
Please help me to make the function of sending a message, I couldn't myself ((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@insighter, 2022-02-09
_

If anything, it's just that sockets are not the same as web sockets (which work on top of HTTP).
Isn't it better to use the standard solution on ASP. NET?
https://docs.microsoft.com/en-us/aspnet/core/funda...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question