File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Using Socket program with Jsp Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Using Socket program with Jsp Servlet" Watch "Using Socket program with Jsp Servlet" New topic

Using Socket program with Jsp Servlet

Anurag Dhiman
Ranch Hand

Joined: Feb 10, 2012
Posts: 32
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

Joined: Mar 22, 2005
Posts: 42965
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

Joined: Mar 22, 2000
Posts: 13037
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?

Anurag Dhiman
Ranch Hand

Joined: Feb 10, 2012
Posts: 32
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

Joined: Jan 03, 2004
Posts: 6109

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.
I agree. Here's the link:
subject: Using Socket program with Jsp Servlet
It's not a secret anymore!