Instant Communication in ASP.NET

B

Benny

Does anyone know of a good way of instant communication between two
users using an ASP.NET interface? I have always been a WinForms guy
and used sockets for communication. I have an SQL Server 2005 database
and was thinking of using Service Broker but i dont even know where to
start, I have thought of using remoting but I dont think there is a way
of the client being notified instantly, which is key. Any suggestions
greatly appreciated.
 
M

Marc Gravell

Using ASP.Net? You must use the central server and "pull" requests -
you can't "push" to a web client. A common approach would be to use
AJAX and a javascript polling loop (every 10 seconds, say), so that
each client can keep asking "anything for me?"... but note that this
can have scalability issues, as each client will keep hitting the
server even when inactive. The 10s is probably too short, too...

Marc
 
L

Laurent Bugnion

Hi,
Does anyone know of a good way of instant communication between two
users using an ASP.NET interface? I have always been a WinForms guy
and used sockets for communication. I have an SQL Server 2005 database
and was thinking of using Service Broker but i dont even know where to
start, I have thought of using remoting but I dont think there is a way
of the client being notified instantly, which is key. Any suggestions
greatly appreciated.

There is a variant of Ajax named COMET. It's a way to send a request to
the web server, and delay the response until either the expected event
occurs, or a timeout. When the response arrives to the client, it is
processed, and then a next request is sent.

COMET works, but it has a few downsides: First, the web browser has only
two concurrent HTTP connection available to one web server (this is
according to the HTTP specifications), and one of them will be "hogged"
by COMET. It means that there will be only one additional HTTP
connection to, for example, refresh a HTML page, download a file, etc...

Also, the web server gets extra load because of this implementation,
because the number of open connections at a given time is higher. If you
want to have that working in a productive environment, you might have to
upgrade your server.

The upside, of course, is that the reaction is as immediate as can be.

You'll find more information about COMET implementations on Google.

HTH,
Laurent
 
S

Samuel R. Neff

The Adobe Flash Player has the ability to maintain open two-way
communications with the server. You can use either Adobe Flash or
Adobe Flex to build an app that provides communication to your primary
app.

It supports communication over XML Sockets, which can easily be
implemented in .NET, or their proprietary RTMP binary protocol which
requires Flash Media Server.

Not as easy as a built-in .NET library but not that difficult either
if you have the time to learn.

Adobe's Flex SDK is free and there are several non-Adobe options for
generating SWF (OpenLaszlo and MTASC).

HTH,

Sam
 
B

Benny

Wow, I think that was the answer I was looking for. I considered AJAX
and the like but realized that in an environment with 50+ clients
polling one central server could be a heavy load, I needed an alternate
way to communicate through a standardize protocol like you have
suggested. Thank you very much for the suggestion, I will be
researching tonight, to say the least ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top