Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Mixing client side user interaction with serverside TCP/IP connections

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic