WebSocket - c # .NET

3

I found almost nothing about WebSockets + .NET in google, I would like to know how this server is done using .NET in the future, the idea is to create an application and hardware (Arduino) that communicates with this WebSocket server. Is it possible to create a WebSocket server in ConsoleAplication or ServiceWindows? or only in ASP.NET (web page)? How is this server created? in JavaScript? or can you do it using C # itself? I did a lot of research, but the logic of WebSocket is still a little vague, if someone can share a simple code just to understand how WebSocket works, I would appreciate it!

    
asked by anonymous 23.02.2018 / 20:38

3 answers

1

You can run the server in the console if you use asp net core (including linux). Ideally, write using the signalr ( npm module ) to make your life easier, allowing you to deploy the web socket without having much knowledge. To run the server in the console simply run the dotnet run command in the project folder or giving the play in visual studio using the console option, I can not remember the name but you will see two, one using IIS Express and the other the console. To learn more about signalr go to the tutorial link

    
27.02.2018 / 15:06
0

The SignalR pair today is the best dem solution for websocket c #.

I think it's worth studying a bit about it.

I use some of my applications, it's very simple to make and manage the connections.

You can choose to connect to all users, a user or user group.

This tutorial from Eduardo Pires helped me a lot: link

    
06.03.2018 / 14:16
-1

Yes you can create a websocket using console application. It is built using C # itself and you can find a sample code in this article in the official documentation >.

This link from MDN has a tutorial "Writing a WebSocket server in C #"

    
27.02.2018 / 14:59