Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AJAX IRCX Client and Server

I am currently developing an IRCX AJAX Chat based system and have a few questions regarding the Server and Client implementation; Any suggestions are welcome:

Server

Should this be implemented as a Web Service, or a Windows Form application? I have experience in developing Windows Forms based servers, however I am wondering if this would be better implemented as a Web Service and if so, why?

Client

How are Web Based Clients implemented today and what is the preferred method to implement a Web Based Client?

My solution so far are

  • ASP.NET Web Forms with an AJAX Update Panel (This seems the most viable)
  • Using jQuery connecting to the web service with a JavaScript timeout

Polling

How frequently should the server be polled for new messages? 0.5 seconds seems a bit excessive and anything between 2 or 3 seconds seems sluggish.

Thanks for your input.

like image 481
Darren Avatar asked Dec 21 '22 22:12

Darren


2 Answers

Have a pool of connections and maintain a sort of proxy between the server and clients that sends the data to the right client based on a session id. This would mean your chat server is protected against packet attacks and you would not have to deal with web sockets which an attacker could hijack and do what they require with it.

like image 137
user1378687 Avatar answered Dec 31 '22 00:12

user1378687


I know the question is old, but there's an even better approach now.

SignalR is designed for things like this (real time web functionality)

SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application. While chat is often used as an example, you can do a whole lot more. Any time a user refreshes a web page to see new data, or the page implements Ajax long polling to retrieve new data, is candidate for using SignalR.

Here's a tutorial for a basic chat application HERE.

For more information, visit the SignalR website.

like image 43
mattytommo Avatar answered Dec 31 '22 01:12

mattytommo