Solved

Simple JAVA Server

Posted on 2001-06-22
3
196 Views
Last Modified: 2013-11-24
Hi,

I'm a newbie in Java so.. please don't laugh ;)

I need a simple Java server on which clients can connect. And every Message one Client send, all connected clients should recieve them.

If somebody maybe have some samples ...

I use JBuilder 4.

Of course the server should be in a own Thread...

Thanks alot
Lycar
0
Comment
Question by:Lycar
  • 2
3 Comments
 
LVL 1

Expert Comment

by:goldwarlock
ID: 6219538
Use Java Servlets
Any example on generic servlet will help you
0
 
LVL 1

Expert Comment

by:goldwarlock
ID: 6219608
btw: visit my site
www.xanga.com/goldwarlock
0
 
LVL 2

Accepted Solution

by:
jorj earned 50 total points
ID: 6223443
You don't need a servlet for this; a java server will do the job.

Basicaly you have to create a server that listens on a port. When a new client connect you will have to create a client object which keep also the port number the clients has connected, its nick and whatever you need and put the client in a list. Any incomming message is then sent by going throught the list and calling a client.sendMessage() method. You must take care of the nickname to be unique in the list, so you can use the nick as an ID in order to know each message's source.

As I saw you are a java programmer so you will not have problem in creating a java server. With the rest I can give you more details if you need.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question