I want to make Asp.NET
Web Chat Application and found that Signalr
is best option for this. I found one sample Project with Long Polling
but it seems that it takes such a long time to send message or it just cancels it. I want to make speedy Chat app like Facebook
and Google
.
Please give me better way to go ahead.
Long Polling usually produces slightly higher average latency and significantly higher latency variability than WebSockets. WebSockets do support compression, but usually per-message.
WebSockets is actually the underlying transport that SignalR uses, at least most of the time. SignalR has the ability to fall back to other ways of transporting messages, such as long-polling over HTTP. This is useful in situations where you don't have WebSockets support.
SignalR uses the new WebSocket transport where available and falls back to older transports where necessary. While you could certainly write your app using WebSocket directly, using SignalR means that a lot of the extra functionality you would need to implement is already done for you.
SignalR is a Microsoft framework specifically designed to facilitate real-time client/server communication. It provides an effective implementation of long polling that doesn't have a deep impact on the server, and at the same time ensures that clients are appropriately updated about what's going on remotely.
The best thing about SignalR
is that you don't have to worry about Long Polling
and WebSockets
, but the framework itself deals with it.
When first launched, SignalR will try to use WebSockets
, because it is the newest and uses the least broadband. Then, it will fallback to Server Sent Events
, Forever Frame
and Long Polling
, all depending on the technology available on the server and on the client.
http://www.asp.net/signalr/overview/getting-started/introduction-to-signalr Here you have these concepts explained.
To sum things up, you shouldn't specify the framework which technology to use, but it should determine for itself (when dealing with each client - browser), depending on the available technology on the server and on the client.
Hope this helps! Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With