Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #28482

Re: Processing SVG from TCP socket

From Martin Honnen <mahotrash@yahoo.de>
Newsgroups comp.lang.javascript
Subject Re: Processing SVG from TCP socket
Date 2015-07-30 10:35 +0200
Organization Liberty Development
Message-ID <mpcnjv$2ge8$1@adenine.netfront.net> (permalink)
References <0c22b48b-318c-40dd-be36-4e27b55ecc12@googlegroups.com>

Show all headers | View raw


Jay Braun wrote:

> 1) How can I get a browser to process SVG (or any XML for that
> matter) that is coming in via a TCP socket? (I'd like to stick with
> TCP since the legacy application already has code to use that
> protocol.) I expect that Javascript or some other programming
> capability can help here; can you point me to a reference?

Inside the browser you can do HTTP requests using XMLHttpRequest 
https://developer.mozilla.org/de/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest 
or open a WebSocket connection 
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications.
I am not aware of any TCP socket support.


> 2) I need to "clear" the display when a new dump begins, and draw the
> brand new dump. Any thought on how to do that?

Are you using SVG within HTML? Or solely SVG? In any case, using W3C DOM 
scripting you can remove nodes and insert new ones respectively replace 
nodes. On the other hand if you want to replace the whole document 
displayed every 10 seconds then a HTTP refresh 
*https://en.wikipedia.org/wiki/Meta_refresh) might be easier, assuming 
your legacy app can do HTTP instead of TCP.

> 3) I will eventually need some event handling, especially mouse
> clicks.

The SVG elements have event handler attributes, see 
http://www.w3.org/TR/SVG11/script.html#EventAttributes and you can also 
attach event listeners using the W3C DOM method addEventListener.



--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Processing SVG from TCP socket Jay Braun <lyngwyst@gmail.com> - 2015-07-29 16:00 -0700
  Re: Processing SVG from TCP socket Martin Honnen <mahotrash@yahoo.de> - 2015-07-30 10:35 +0200
    Re: Processing SVG from TCP socket "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-07-30 10:50 +0200
      Re: Processing SVG from TCP socket Martin Honnen <mahotrash@yahoo.de> - 2015-07-30 11:04 +0200
        Re: Processing SVG from TCP socket "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-07-30 12:29 +0200
  Re: Processing SVG from TCP socket Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-07-30 17:43 +0800

csiph-web