Meaningless Drivel is fun!*
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
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Using Socket program with Jsp Servlet" Watch "Using Socket program with Jsp Servlet" New topic
Author

Using Socket program with Jsp Servlet

Anurag Dhiman
Greenhorn

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

Joined: Mar 22, 2005
Posts: 41509
    
  53
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.


Ping & DNS - my free Android networking tools app
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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
Greenhorn

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

Joined: Jan 03, 2004
Posts: 6109
    
    6

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: http://aspose.com/file-tools
 
subject: Using Socket program with Jsp Servlet