File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Chat Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Chat Application" Watch "Chat Application" New topic
Author

Chat Application

chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

I am writing a chat application involving one server and multiple clients. However, when clients chat, the messages should not pass through server.
This is what i intend to do:

> Send chat request to server
> Server replies with credientials(IP,Port) of the other client
> Establish a connection with other client and proceed with the chat.

I am facing a problem in the 3rd step. I dont know how to establish a connection between client and another client?.
For establishing a connection between client and server i have used socket and server sockets. What is the way of establishing connection between client and another client?


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
The clients will have to listen for incoming connections, just like your server...


OCJP 6 (93%)
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Does that mean each client will also have a server socket associated with it?
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
chander shivdasani wrote:Does that mean each client will also have a server socket associated with it?


Yes.
 
Don't get me started about those stupid light bulbs.
 
subject: Chat Application
 
Similar Threads
Chat Application...
Client-Client Communication
Relation between Internet Explorer and Socket Connection
How to provide th ordering of applications in JBoss
Client window opening in Server Machine..!