can I use tomcat server for my chatting application?

Hello,
I have a socket programming code to do chatting(both server and client).
But this is limited to a single machines with multi users.
But my target is to perform chat operation on multiple IP addresses in a given LAN in college.

Can you please tell me if I can use TOMCAT as my server to perform this.If yes, can you guide me how.If no, can you please tell me what other server can I use to suit this requirement !!!!

awaiting your reply !!!

It depends on how you want users to chat. Implementing a (1) 100% Web-based chatroom (no applet), or (2) users use applet from a Web page to chat? Or (3) users have dedicated clients (e.g. swing GUI) for chat?

I hope this is not college assignment. We don't allow posting these kind of questions here. But I will not post any code anyway as they are not something you can do with just a few lines of code and you should try to explore on your own.

(3) The GUI client can support any client-server socket protocol so this is the most traditional way to do this
(2) An applet can have limited networking capability so you can mostly use your own protocol as in case (3)
(1) Without applet, immediate refresh of message on Web page may be triggered by AJAX. You can use Tomcat (or even application server such as JBoss) to host an application server with state managed on it. However, to avoid excessive AJAX polling, you can use Jetty instead of Tomcat, that supports "continuations" so that it can push update to client instead of requiring polling from client side. Actually, the Jetty distribution has an example that exactly demonstrates how to create a chatroom using this method.

Hi cbkihong,
this is not my college assignment sir.
I and my team are modifying the bash shell and we are adding many modules to it.
We also wanted to include a cross-platform chat system.
Thats why I was asking abt a host server. I do abide by the rules of the forum.I would hereby ensure u that I would not put up any assignments, etc.

Can u please give me a sample links which tell me abt the Jetty and its chat application that u were telling in the previous post......

OK. It was my duty to make sure this is not homework assignment. Anyway, my apologies.

Jetty is a web container like Tomcat. However, Jetty supports a unique feature called "continuation" that makes AJAX-based web applications a lot more scalable compared with conventional client polling-based solutions. This makes it ideal for implementing chat-like functionality where changes needed to be pushed actively by server to individual clients.

Actually I just found a test deployed Jetty from Google search that contains the sample.

http://64.164.6.244:9090/test/chat/chat.html

The actual sample code can be obtained from the Jetty6 download area. Jetty's site:

jetty - Jetty WebServer