username1565 / Fleck2

C# Websocket Implementation with NET 2.0 support
MIT License
0 stars 0 forks source link

Intruduction. #1

Open username1565 opened 5 years ago

username1565 commented 5 years ago

WebSockets is good, because only one connection is opened between client and server. This is like TCP sockets + handshake is supporting there. No need to send many XHR queries, and open many connections to get response for this queries, before close this connections after receive response. You can see this all in your firewall, or sniffer.

Browsers can not working with sockets, but this can working with websockets. Clients, can working with websockets, using JavaScript. But... To working with this websockets, need to run WebSocket-server.

Fleck2 - this is a small websocket server, writted on C#. This can be compiled on Windows and runned there. This branch can return, after compilation, the Fleck2.dll for different version .NET Framework, and the demo - working without dlls.

To see demo-chat on websockets, just ownload this branch as zip-archive, and run \build.bat, or \demo\Compile.bat (to don't compile dll-files). After this, you can see compiles demo-server in the folder demo\bin\Release\. Then run start_Fleck2_demo.bat wait for opening client.html in your browser, and begin the chat with server using websocket. All your writted messages in the client.html - will be delivered in the server console, and websocket-server will return the echo response.

The source code from this branch was been sucessfully compiled and runned on Windows XP with .NET Framework 4.0. Bugs are fixed. See source the code.

Have a nice day.

username1565 commented 5 years ago

Maybe, this can be used as

using System.Net.WebSockets;

in .NET Framework <= 4.5