Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Socket program with Jsp Servlet

 
Anurag Dhiman
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone!!
I am working on an application using jsp servlet. My requirement is whenever data is inserted into database send notification to all the system connected on lan,.
Right now application is working on server and expected to send notifications from that system to different clients.
I tried it using socket program but still facing some problems

Please give me some ideas or useful links.





Thanks to all!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are "all the system connected on lan"? What does "send notifications" mean, exactly? What have you tried, and how has that not worked according to what you expected? TellTheDetails.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What sort of program are you allowed to run on all the client systems? Do these client systems already have an application running that uses this information?

Bill
 
Anurag Dhiman
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Socket programs to do this. ServerSocket program I have installed in server machine and ClientSocket on different machines connected to same lan. For the first time when I am inserting records into DB the SocketServer send notifications to all client machines(only after runing ClientSocket). I just wanted to automate ClientSocket so that no need to run it again and again on client machine. On each insertion I need a notification on client machine without runing it manually
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to send a message from one host to another, then there has to be something running on that host to receive the message. So you need to either have your ClientSocket program running all the time, or else you need to pick some central place to deposit these messages, and use cron or Windows Task Scheduler to start your ClientSocket program periodically to check for updates.

It might be possible to have your ClientSocket program start in response to some sort of UPnP message, but I don't know if that service works that way.

In general though, there's no way to have one host receive a message from another host unless there's some service running that's listening for that message.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic