aspose file tools
The moose likes Applets and the fly likes Reg. Applet Chat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Reg. Applet Chat " Watch "Reg. Applet Chat " New topic
Author

Reg. Applet Chat

Anbu Kumar
Greenhorn

Joined: Jan 17, 2007
Posts: 1
Hi All

I have developed 2 programs
(1) Server.java (Normal Java Program with port no. say 1001)
(2) Client.java (Which binds to the server at the port no. 1001) - Applet File , with lots of option of paint, chat

Execution mode :
Server.java executed once
Client.java - in one cmd prompt Say Client 'A'
Client.java - seperate window Say Client 'B'
Client.java - seperate window Say Client 'C'
Client.java - seperate window Say Client 'D'

Whatever A types reflect in all the rest of the clients 'B','C','D'.

But i would like to do a privacy chat between 'A' - 'B' and 'C' - 'D'.

Will i need to create another server with diff port.. If yes, assume if i want to provide 1000 privacy chat between the users.. then?

One more Ques : If i want to create many server programs with diff port number during runtime, how can i check whether the port is already running or not?

Awaiting for earliest reply
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
Welcome to JavaRanch.

Having a single ServerSocket should be sufficient. Each client should indicate somehow to which other clients its messages should be sent; the server then should honor that.

If you try to open a ServerSocket on a port that's already is use, an exception will be thrown.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg. Applet Chat
 
Similar Threads
how to connect to other machine rather than localhost.
How to make a Serverless java LAN Chat application with a user list
Server Socket for chat
java programs in vi editor
java.net Socket port number question