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
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
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.