Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can i send a message to my client using his IPaddress ?

 
Rasmeet Devji
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I have not worked much on servlets, but am supposed to develop a chat application. I wanted to know if it were possible to send messages to specified users using their ipaddresses ?
Awaiting all the help in the world!(help in any form)
Thanx!
Rasmeet
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rasmeet,
If client initializes the communication, then you will avoid a lot of security issues. Once the client has made contact (for instance, use a java.net.ServerSocket to listen) then you can set up a socket connection using


For a nice, clean socket-based chat example, have a look at this http://homepages.unl.ac.uk/~wrightc/tyj/Comms.htm#ChatServer
Notice the use of a static Vector of handlers in the ChatHandler class to allow for inter-client communication and broadcasts - very slick! Hope this helps
Sean
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic