File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes How to create a chat server for my hostel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to create a chat server for my hostel" Watch "How to create a chat server for my hostel" New topic

How to create a chat server for my hostel

Anupam Dee
Ranch Hand

Joined: Oct 18, 2010
Posts: 42

Hello guys i wanna create a chat server-client for my hostel...
i wanna need some guidelines...
how i should begin......

how should i program the server and so many clients chatting at the same me please..
Anupam Dee
Ranch Hand

Joined: Oct 18, 2010
Posts: 42

It can be assumed like the scenario of facebook or google chat...
can i use apache tomacat server for this purpose....or will have to code the server that will run on another server...
just help me please
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

I would have thought that after all these years, and everybody and his uncle trying to write a chat server, that by now it would be possible to get a pre-written chat server and install it somewhere. Are you sure you want to write yet another chat server from scratch instead of just getting one which has already been written?
Anupam Dee
Ranch Hand

Joined: Oct 18, 2010
Posts: 42

yes i want to write it again from scratch...
please help me how to begin...
see i know servlet programming and net programming...but how the application would be constructed...that's what i want to know
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

There is to get you started. It's not code, but it'll get you started. If you need a basic example of a client or server, I will give you it. I started making my first one when I found a SUPER simple server/client program (source code) and built off of that.

Good luck,
John Price

EDIT : This is on the server. On the client, you need to do something like this :

EDIT (2) : Make the server an Application. Make the client an Application or Applet. Applet will be harder (permissions, signing the JAR files, put it on a website with bandwidth, etc), but more convenient for the user. Application is easier, but less convenient for the user.

“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Angus Comber
Ranch Hand

Joined: Jul 16, 2011
Posts: 90
Get hold of the Head first Java book. Read the networking and threads chapter (read it all actually). This same chapter has a sample chat client and server. this would make a good start.

You are going to need to know about Java io, sockets and multi-threading. Plus some gui stuff for the client.
I agree. Here's the link:
subject: How to create a chat server for my hostel
It's not a secret anymore!