aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Chat Application... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Chat Application..." Watch "Chat Application..." New topic
Author

Chat Application...

Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
<p>I'm making this project for school that implements a chat application... Now i have read a book Professional Java Programming by Brett Spell and tackled on Distributed Objects... and there, it implemented a crude chat application using SOCKETS... but the way the code was made, it was like simulating Distributed Objects since the code had proxy and stubs on the server and the client program respectively....
</p>
<p>
I'm just wondering if it is possible to implement a chat application withSOCKETS without simulating stubs and proxy?
</p>


it's alright, the gun isn't loaded... - hey
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Anthony,
Sure. The question is what information will be sent with each message and how will you encapsulate it? Will you use a central server to route all the messages or use some sort of broadcast scheme? If you want a pure socket solution, then you will probably decide to use ObjectInputStreams and ObjectOutputStreams for encapsulating the chat messages. Having a central server to keep a diretory of logged chatters and to route the messages is probably the simpler solution.
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
basha khan
Ranch Hand

Joined: Jan 18, 2002
Posts: 87
hi ..i m new to this forum..
with SOCKETS chat is possible and on my openion, sockets r better than RMI/CORBA for chat application.Make ur own protocol and go ahead..
basha.
SCJP
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
Hey Mike!!!
So what you're saying is that its possible not to user proxies, skeleteons and stubs?
well i had already grasped the ideas on SOCKETS... but i got confused when i saw codes with skeletons and stubs (thru inner classes)...
My plan is to simulate Yahoo Messenger style chat... and yeah,probably i would have a central server...
when a client is connected to a server, the client GUI immediately shows online users and he can only get that thru the central server...
now the client gui is like a JTree, the child nodes correspond to online users.... and then when I click on a particular node, i then establish a connection between the user i clicked, create a new window(main chat interface), and I can get the inetadddress of the other client thru info from the central server....
is this possible? How do I do that? my question is: in the client program, how do i keep track of the online users when that information is coming from the server? do I have to store reference of the server in my client program?
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Hi anthony
I,am working on a similar chat application. When you create a connection with the remote client by getting his inetaddress , how will the remote client send the messages to the client which got connected to it ? . Will the central chat server do some sort of routing ? cos the remote client is actually connected to the central chat server.
Please guide me a bit.
Thanks in advance

Originally posted by Anthony Yulo:
Hey Mike!!!
when a client is connected to a server, the client GUI immediately shows online users and he can only get that thru the central server...
now the client gui is like a JTree, the child nodes correspond to online users.... and then when I click on a particular node, i then establish a connection between the user i clicked, create a new window(main chat interface), and I can get the inetadddress of the other client thru info from the central server....
is this possible? How do I do that? my question is: in the client program, how do i keep track of the online users when that information is coming from the server? do I have to store reference of the server in my client program?


Raghav.
 
wood burning stoves
 
subject: Chat Application...