File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes SERVER PROGRAM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SERVER PROGRAM" Watch "SERVER PROGRAM" New topic



Joined: Mar 02, 2002
Posts: 1
hi, i am having problems writing a program that will allow two user to send messages to each other.

1. The messages can contain more than one
And the programs should allow the user to finish typing an outgoing message before it displays any incoming messages from the other user.
2. The messages do not have to be sent
I.e. it should be possible for one user to
send several messages before the other user
sends a reply.

thanks to anyone who can solve this
email :
[ March 02, 2002: Message edited by: tonyb ]
Prashanth menon
Ranch Hand

Joined: Feb 20, 2001
Posts: 65
The first question is not quite clear. I think its contrary to the second one. If the incoming message should be displayed only after the outgoing message, then it is same as the second case. That is message sent alternately.
If this should go simultaenous, then please try using multithreading. The outstream can be put on a thread different from the instream. So even if one is idle other can send message.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Originally posted by tonyb:
hi, i am having problems writing a program that will allow two user to send messages to each other.
Why not show what you have and show where you are stuck. Obviously this is your homework so we don't want to do it for you but we are willing to help.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!

Arijit Ghosh
Ranch Hand

Joined: Feb 01, 2002
Posts: 174
All I would like to state here is that this can be handled efficiently by JMS.
I agree. Here's the link:
It's not a secret anymore!