• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mixing client side user interaction with serverside TCP/IP connections  RSS feed

 
Adam Collins
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a fairly strange problem, and I have no idea what sort of framework I should be using, Servlets look the most promising.
Situation:
I need to interface with an external TCP/IP device that is on the local network and can be connected to using hyperterminal (SSH) or by a socket connection for reading/writing ASCII.
I need to be able to read events from this device and on an event change content on an HTML page being served.

To date I have managed to open a socket to Hyperterminal (localhost) and write an ASCII string to it by sumbitting a form to a JSP page that extracts form data opens the socket writes the data and closes the socket.

I still have no idea how to read from the socket and alter the page as that would require the server app to be continuously running and then send a refresh command to the page with updated details? anyone know if that is possible and if security restrictions will even allow a socket connection to another machine on the network.

Any help would be appreciated. thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then send a refresh command to the page with updated details?

Servlets and web browsers work on a request/response cycle so you can.t tell a browser anything if it has not made a request. Some sort of JavaScript on the browser side that checks frequently for updates is your best bet.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!