Reputation: 301
I am a Java beginner. I googled for one week for the solution. Now I'm posting this question. I want to develop a chat application in Java.
How can I achieve this? How can I check which users are online? How can I integrate this with my current website?
Upvotes: 1
Views: 1775
Reputation: 1
You can use Java RMI too. Of course it won't require any Web Container. Using RMI and Multi threading you can come up with a fairly working Chat application.
Upvotes: 0
Reputation: 3056
You will need sockets to solve your Problem.
Look at at the ServerSocket class. http://download.oracle.com/javase/1.5.0/docs/api/java/net/ServerSocket.html
call await in a while true loop (maybe in a new thread). It returns a new Socket (client Socket)
Save those in a List
have fun with it. :)
Upvotes: 0
Reputation: 1998
I am surprised that you didn't find any Java chat server solutions after Googling. Just did a search for Java chat server and it returned 1.15million hits. The first of which was a list of open source Java chat server source codes.
Generally, writing server applications in Java is fairly easy, but if you are looking at a high volume chat application (>1000 users), I would recommend moving onto a different platform such as C++.
You will also need to provide some more information about your user list. Is it on a DB or AD etc.
Upvotes: 1