Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does xsockets.net (.NET WebSocket Server) run on Windows 2008?

I am comparing WebSocket servers

  1. xsockets.net
  2. SuperWebSocket
  3. Fleck
  4. SignalR

SignalR is only available on Server 2012, but my servers are running Windows 2008.

SuperWebSocket & Fleck, they only support flash-proxy fallback.

xsockets.net, this one has long-pooling fallback support in elder web browser. But it says the fallback is only available to MVC3/4 project. Can it open a port in MVC3/4 application to accept connections for clients which support websocket? It seems impossible to me on Windows 2008.

I have the question, that is: how does XSockets.NET run in Windows 2008?

As you know, WebSocket feature is not added in http.sys until IIS8.0. In IIS7.5, SignalR always run in long-pooling mode for all clients.

Is it the same for XSockets.NET? because it is said the long-pooling fallback is only supported in MVC3/4 project. If I want to take the advantage of fallback support, I must use XSockets.NET in MVC3/4 which is finally hosted by IIS. And IIS7.5 does not have the feature of websocket, that is what I am afraid of

Does anyone know how it works in IIS7.5 which hosts the MVC application? Handle all the clients via long-pooling?

like image 285
Mr.Wang from Next Door Avatar asked Jul 30 '13 06:07

Mr.Wang from Next Door


People also ask

How do I run a WebSocket on a server?

var server = new WebSocketServer("ws://localhost:8181"); Any valid URL can be used with the specification of a port, which was not used earlier. It is very useful to keep a record of the connected clients, as it provides details with different data or send different messages to each one.

How do I enable websockets in Windows?

- In Control Panel, click Programs and Features, and then click Turn Windows features on or off. Expand Internet Information Services, expand World Wide Web Services, expand Application Development Features, and then select WebSocket Protocol. Click OK. Click Close.

Does WebSocket need a server?

By definition websockets like normal sockets are client-server so yes, you need a server.


1 Answers

Edit:

Compability

XSockets will be websocket compatible on any machine running .NET 4,0 (or later) or Mono. This is regardless of operating system... You can even run the complete XSockets on a Raspberry PI if you want to. The only time XSockets will use the fallback is if the client connecting does not support websockets (IE9, IE8 etc).

SignalR has built the WebSocket support upon .NET 4.5 and the built-in WebSocket namespace (in 4.5) while XSockets has implemented the WebSocket protocol in .NET 4.0 (among other things). SignalR and XSockets has really nothing in comment besides that they both are built on .NET framework, after that the look very different... But that is out of scope.

Environment

Since XSockets has implemented the WebSocket protocol by it self this means that XSockets is not dependent on any webserver, IIS, Apache etc... It can run as a standalone windows service or on Azure if you like. However, you can also start XSockets within your web and that´s actually how it is setup when you install our nuget package.

Fallback

When you install XSockets into a MVC3/MVC4 solution the installation will automatically register an additional controller. This controller will use our External API (sockets) to communicate with XSockets and the JavaScript API will do AJAX (longpolling) against this controller if the client lacks support for websockets. As a developer you do not need to do anything different besides adding an additional JavaScript file if you want to use the fallback.

Now, you can make the fallback work for WebForms (and Azure) as well, but since that is out of scope we leave that for later if you have questions about it.

Bottom Line To wrap up...

  • Do not worry about XSockets needing a special OS for running, we run on any Windows/Unix/Linux environment as long as .NET 4.0 or Mono is installed.
  • XSockets run inside IIS, in Azure, as a Windows Service or just a console application... You can even run the server on Raspberry PI or anything else really (a phone or whatever) as long as the requirements for .NET/Mono is full filled.
  • XSockets can be developed both in .NET/Mono environments, so you can actually develop plugin from both a MAC using Xamarin and Windows using Visual Studio.
  • The fallback get automatically setup when you install it for development in MVC3/MVC4 but you can also setup fallback on Azure and WebForms.
  • SignalR have the server environment deciding whether the clients can use websockets or not, XSockets always have websockets and fallback to longpolling only when the client does not support websockets.
like image 151
Uffe Avatar answered Oct 18 '22 13:10

Uffe