[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Simple JAVA Server

Posted on 2001-06-22
3
Medium Priority
?
229 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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month19 days, 8 hours left to enroll

872 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