title: Accept commands in Java application, send from ASP.net web application
body: <p>I want to achieve some kind of remote control web application.</p>
  
  <p>What I have now is a java application that runs on my computer. I want it to listen for commands from a web page, which I run in ASP.net on my own server. The Java application should do it's business, but at the same time listen for commands. If a command is recieved from the server, it should break what it is doing, and do what the command says. </p>
  
  <p>Example:</p>
  
  <p>*The Java application is currently feeding dogs. It gives them 1 treat every second.</p>
  
  <p>*I navigate to my web application, and press the button "Feed cats 1 treat every second".</p>
  
  <p>*The Java application stops feeding the dogs, and starts feeding the cats.</p>
  
  <p>*I navigate to my web application again, and change the amount to 4 treats every second.</p>
  
  <p>*The Java application changes the amount to 4 treats per second.</p>
  
  <p>How would I approach the connection between the Java application and my ASP.net application? I've read about Sockets and Serversockets, but I'm a little unsure on what to use for this exact issue.</p>