Example: VMS to Web Browser "push" technology - VMS

This is a discussion on Example: VMS to Web Browser "push" technology - VMS ; Hi, If you'd like to see an example of a bog-standard VMS server that sends UDP messages to Web-client subscribers, then please follow these instructions: - 1) Click on the following link and read the instructions: http://manson.vistech.net/~tier3/tier3pager.html 2) Telnet to ...

+ Reply to Thread
Results 1 to 18 of 18

Thread: Example: VMS to Web Browser "push" technology

  1. Example: VMS to Web Browser "push" technology

    Hi,

    If you'd like to see an example of a bog-standard VMS server that sends UDP
    messages to Web-client subscribers, then please follow these instructions: -

    1) Click on the following link and read the instructions:
    http://manson.vistech.net/~tier3/tier3pager.html

    2) Telnet to manson.vistech.net. (If you don't already have an account on
    the Deathrow cluster then please use Username: DEMO Password: USER) and
    then:

    $set term/width=132
    $run sys$users:[users.tier3.web]demo_udp_msg

    3) Enter the IP address of your client node. Your "stock-monitor" from step
    1 should now spring into life with ransom stock-prices generated at 2sec
    intervals. (NATed clients will find this bit problematic :-)

    4) Enter any adhoc messages that you wish to appear in the seperate Java
    Frame on the client.

    OPCOM messages to web-subscribers? CHAT conferences? Stock-Watching? Alarm
    Monitoring? - I mean what's it all about?

    Cheers Richard Maher

    PS. The code for Tier3Pager.java aqnd DEMO_UDP_MSG.COB are below, but all
    can be found at SYS$USERS:[USERS.TIER3.WEB]

    Tier3Pager.java
    ===========

    /**
    * Copyight Tier3 Software. All rights reserved.
    *
    * Author: Richard Maher
    *
    **/

    import java.applet.Applet;
    import java.awt.*;
    import java.net.*;
    import java.io.IOException;
    import netscape.javascript.JSObject;
    import netscape.javascript.JSException;

    public class Tier3Pager extends Applet
    {
    private String hostName;
    private JSObject browser;
    private static MessageThread socketThread;
    private static Tier3Talk chat;

    public class MessageThread extends Thread
    {
    private DatagramSocket socket;
    private DatagramPacket packet;
    private String threadData;

    public MessageThread(String name, String txt) throws Exception
    {
    super(name);

    byte[] buffer;
    threadData = txt;

    String port = getParameter("PORT");
    String maxBuf = getParameter("MAXBUF");
    try
    {
    if (port == null)
    socket = new DatagramSocket();
    else
    socket = new DatagramSocket(Integer.parseInt(port));

    if (maxBuf == null)
    buffer = new byte[512];
    else
    buffer = new byte[Integer.parseInt(maxBuf)];

    packet = new DatagramPacket(buffer, buffer.length);
    }
    catch (Exception e)
    {
    e.printStackTrace();
    System.out.println("Unable to create UDP Socket");
    throw new Exception("Message thread could not be created");
    }

    setDaemon(true);
    start();
    }

    public void shutdown()
    {
    socket.close();
    }

    public int getLocalPort()
    {
    return socket.getLocalPort();
    }

    public void run()
    {
    System.out.println("Started Message thread. ThreadData = " +
    threadData);
    String args[] = {"Started Message Thread " + threadData};
    browser.call("alert", args);
    boolean stopThread = false;

    readLoop:
    while (!stopThread)
    {
    try
    {
    socket.receive(packet);
    String received = new String(packet.getData(), 0,
    packet.getLength());
    processMessage(received);
    }
    catch (SocketException e)
    {
    System.out.println("Shutting up shop");
    stopThread = true;
    continue readLoop;
    }
    catch (IOException e)
    {
    e.printStackTrace();
    System.out.println("Unable to retrieve UDP message");
    }
    }

    System.out.println("Thread run() unit terminating");
    }

    public void processMessage(String msgText)
    {
    int msgType = Integer.parseInt(msgText.substring(0,2));
    switch (msgType){
    case 1:
    chat.append(msgText.substring(2));
    break;
    case 2:
    String args[] = {msgText.substring(2)};
    try {browser.call("priceUpdate", args);}
    catch (JSException e)
    {
    System.out.println("Error when calling JS
    priceUpdate()");
    }
    break;
    default:
    System.out.println("Unknown rec type
    "+msgText);
    }
    }
    }

    public void init()
    {
    System.out.println("Initializing. . .");
    hostName = getCodeBase().getHost();

    chat = new Tier3Talk("Tier3 Messages");
    requestFocus();

    browser = JSObject.getWindow(this);

    if (socketThread == null)
    {
    try
    {
    socketThread = new MessageThread("MsgDaemon", "SomeData");
    }
    catch (Exception e)
    {
    e.printStackTrace();
    System.out.println("Could not init Tier3Pager");
    }
    }
    }

    public void alert(String alertText)
    {
    String args[] = {alertText};
    browser.call("alert", args);
    }

    public void destroy()
    {
    if (chat != null)
    chat.dispose();

    boolean stillDying;

    if (socketThread != null){
    socketThread.shutdown();
    do
    {
    stillDying = false;
    System.out.println("Joining MessageThread");
    try {socketThread.join();}
    catch (InterruptedException e){
    System.out.println("Interrupted Join");
    stillDying = true;
    }
    } while (stillDying);

    socketThread = null;
    }

    System.out.println("Tier3Pager Applet Rundown complete");
    super.destroy();
    }
    }


    DEMO_UDP_MSG.COB
    ====================

    ************************************************** **************************
    ********
    *
    *
    * COPYRIGHT (c) BY TIER3 SOFTWARE LTD. ALL RIGHTS RESERVED.
    *
    *
    *
    * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
    ONLY *
    * IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF SUCH LICENSE AND WITH
    THE *
    * THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY
    OTHER *
    * COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO
    ANY *
    * OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS
    HEREBY *
    * TRANSFERRED.
    *
    *
    *
    * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
    AND *
    * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY TIER3 SOFTWARE LTD.
    *
    *
    *
    ************************************************** **************************
    ********
    *+
    * Facilility: DEMO_UDP_MSG
    *
    * Abstract: Send a UDP message to a Java Applet Web client
    *
    * Build example:
    * $COBOL/LIST DEMO_UDP_MSG
    * $MACRO/LIST DEMO_TCP_IP_DEF
    * $LINK DEMO_UDP_MSG, DEMO_TCP_IP_DEF
    * $RUN DEMO_UDP_MSG
    *-
    identification division.
    program-id. demo_udp_msg.
    data division.
    working-storage section.
    01 stock_ticker pic s9(9) comp value external
    stock_ticker.
    01 acp_gethostbyname pic s9(9) comp value external
    acp_gethostbyname.
    01 io$_setmode pic s9(9) comp value external
    io$_setmode.
    01 io$_writevblk pic s9(9) comp value external
    io$_writevblk.
    01 io$_acpcontrol pic s9(9) comp value external
    io$_acpcontrol.
    01 ss$_bufferovf pic s9(9) comp value external
    ss$_bufferovf.
    01 ss$_endoffile pic s9(9) comp value external
    ss$_endoffile.
    01 ss$_abort pic s9(9) comp value external
    ss$_abort.
    01 ss$_normal pic s9(9) comp value external
    ss$_normal.
    01 sys_status pic s9(9) comp.
    *
    01 iosb.
    03 cond_val pic s9(4) comp.
    03 byte_count pic s9(4) comp.
    03 pic s9(9) comp.
    *
    01 create_socket.
    03 pic s9(4) comp value external
    ucx$c_udp.
    03 pic s9(4) comp value external
    inet_protyp$c_dgram.
    *
    01 local_sock_desc.
    03 pic s9(9) comp value 16.
    03 pointer value
    reference local_addr.
    01 local_addr.
    03 pic s9(4) comp value external
    ucx$c_af_inet.
    03 local_port_number.
    05 low_byte pic x value
    low-values.
    05 high_byte pic x value
    low-values.
    03 pic s9(9) comp value external
    ucx$c_inaddr_any.
    03 pic x(8).
    *
    01 ast_area.
    03 net_chan pic s9(4) comp.
    03 stock_delta_secs pic s9(11)v9(7) comp value -2.
    03 seed pic 9(9) comp.
    03 ast_iosb.
    05 ast_cond pic s9(4) comp.
    05 pic x(6).
    03 rem_sock_desc.
    05 pic s9(9) comp value 16.
    05 pointer value
    reference rem_addr.
    *+
    * Use port number 1234 for example's sake
    *-
    01 rem_addr.
    03 pic s9(4) comp value external
    ucx$c_af_inet.
    03 rem_port_number.
    05 low_byte pic x value x"04".
    05 high_byte pic x value x"D2".
    03 rem_node_addr pic x(4).
    03 pic x(8).
    *
    01 in_addr_name pic x(60).
    01 in_addr_name_len pic 9(4) comp.
    01 out_len pic 9(4) comp.
    *
    01 message_buffer.
    03 message_type pic x(2) value "01".
    03 message_text pic x(30).
    *
    01 user_exit pic x value "N".
    01 end_key pic x(4).
    01 in_time pic 9(8).
    *
    procedure division.
    kick_off section.
    00.
    accept in_time from time.
    move in_time to seed.

    display "Enter Client's IP address or name: " erase screen no advancing.
    accept in_addr_name protected reversed at end go to fini.

    if in_addr_name = spaces go to fini.

    perform get_udp_socket.
    if sys_status not = ss$_normal go to fini.

    move "Stock Ticker is now on-line" to message_text.
    perform send_message.

    call "sys$dclast"
    using by value stock_ticker
    by reference ast_area
    by value 0
    giving sys_status.
    if sys_status not = ss$_normal go to fini.

    perform get_user_message until user_exit = "Y" or sys_status not =
    ss$_normal.
    if sys_status not = ss$_normal go to fini.

    perform socket_close.
    *
    fini.
    call "sys$exit" using by value sys_status.
    *
    get_user_message section.
    00.
    display "Enter message text (ctrl/z = exit): " no advancing.
    accept message_text reversed
    bold
    protected
    default is space
    at end move "Y" to user_exit
    go to fini.

    perform send_message.
    *
    fini.
    *
    send_message section.
    00.
    *+
    * Call my Applet.
    *-
    call "sys$qiow"
    using by value 0, net_chan, io$_writevblk
    by reference iosb
    by value 0, 0
    by reference message_buffer
    by value 32
    by reference rem_sock_desc
    by value 0, 0, 0
    giving sys_status.
    if sys_status = ss$_normal move cond_val to sys_status.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.
    *
    get_udp_socket section.
    00.
    call "sys$assign"
    using by descriptor "_BG:"
    by reference net_chan
    by value 0, 0, 0
    giving sys_status.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.
    *
    call "str$trim"
    using by descriptor in_addr_name, in_addr_name
    by reference in_addr_name_len
    giving sys_status.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.

    call "sys$qiow"
    using by value 0, net_chan, io$_acpcontrol
    by reference iosb
    by value 0, 0
    by descriptor acp_gethostbyname,
    in_addr_name(1:in_addr_name_len)
    by reference out_len
    by descriptor rem_node_addr
    by value 0, 0
    giving sys_status.
    if sys_status = ss$_normal move cond_val to sys_status.
    *
    evaluate sys_status
    when ss$_endoffile display "Unknown node"
    when other continue
    end-evaluate.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.

    call "sys$qiow"
    using by value 0, net_chan, io$_setmode
    by reference iosb
    by value 0, 0
    by reference create_socket, omitted, local_sock_desc
    by value 0, 0, 0
    giving sys_status.
    if sys_status = ss$_normal move cond_val to sys_status.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.
    *
    socket_close section.
    00.
    call "sys$dassgn" using by value net_chan giving sys_status.
    *
    end program demo_udp_msg.
    identification division.
    program-id. stock_ticker.
    data division.
    working-storage section.
    01 stock_ast pic s9(9) comp value external
    stock_ast.
    01 io$_writevblk pic s9(9) comp value external
    io$_writevblk.
    01 ss$_normal pic s9(9) comp value external
    ss$_normal.
    01 sys_status pic s9(9) comp.
    *
    01 random_num comp-1.
    01 stock_message.
    03 pic x(2) value "02".
    03 stock_price pic zz9.99.
    *
    linkage section.
    *
    01 ast_area.
    03 net_chan pic s9(4) comp.
    03 stock_delta_secs pic s9(11)v9(7) comp.
    03 seed pic 9(9) comp.
    03 ast_iosb.
    05 ast_cond pic s9(4) comp.
    05 pic x(6).
    03 rem_sock_desc.
    05 pic s9(9) comp.
    05 pointer.
    *
    procedure division using ast_area.
    00.
    call "mth$random" using seed giving random_num.
    multiply random_num by 100 giving stock_price.

    call "sys$qio"
    using by value 0, net_chan, io$_writevblk
    by reference ast_iosb
    by value stock_ast
    by reference ast_area, stock_message
    by value 8
    by reference rem_sock_desc
    by value 0, 0, 0
    giving sys_status.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.

    exit program.
    *
    end program stock_ticker.
    identification division.
    program-id. stock_ast.
    data division.
    working-storage section.
    01 stock_ticker pic s9(9) comp value external
    stock_ticker.
    01 ss$_normal pic s9(9) comp value external
    ss$_normal.
    01 sys_status pic s9(9) comp.
    *
    linkage section.
    01 ast_area.
    03 net_chan pic s9(4) comp.
    03 stock_delta_secs pic s9(11)v9(7) comp.
    03 seed pic 9(9) comp.
    03 ast_iosb.
    05 ast_cond pic s9(4) comp.
    05 ast_bytes pic s9(4) comp.
    05 unix_cond pic s9(9) comp.
    03 rem_sock_desc.
    05 pic s9(9) comp.
    05 pointer.
    *+
    procedure division using ast_area.
    00.
    if ast_cond not = ss$_normal call "lib$stop" using by value sys_status.

    call "sys$setimr"
    using by value 0
    by reference stock_delta_secs
    by value stock_ticker
    by reference ast_area
    by value 0
    giving sys_status.
    if sys_status not = ss$_normal call "lib$stop" using by value
    sys_status.

    exit program.
    *
    end program stock_ast.





  2. Re: Example: VMS to Web Browser "push" technology

    In article , "Richard Maher" writes:
    >Hi,
    >
    >3) Enter the IP address of your client node. Your "stock-monitor" from step
    >1 should now spring into life with ransom stock-prices generated at 2sec
    >intervals. (NATed clients will find this bit problematic :-)
    >

    I knew the government suspected shorters of spreading rumours etc to trash
    companies stock prices but ransoming stock prices is taking it to a whole new
    level


    David Webb
    Security team leader
    CCSS
    Middlesex University

  3. Re: Example: VMS to Web Browser "push" technology

    OK, tested sucessfuly. Some comments below.

    Interesting... :-)

    Best Regards,
    Jan-Erik.

    Richard Maher wrote:
    > Hi,
    >
    > If you'd like to see an example of a bog-standard VMS server that sends UDP
    > messages to Web-client subscribers, then please follow these instructions: -
    >
    > 1) Click on the following link and read the instructions:
    > http://manson.vistech.net/~tier3/tier3pager.html


    OK, that bringed up the "Tier3 push Integration Demo" page in
    a new tab in my Firefox. So far so good...

    > 2) Telnet to manson.vistech.net. (If you don't already have an account on
    > the Deathrow cluster then please use Username: DEMO Password: USER) and
    > then:
    >
    > $set term/width=132
    > $run sys$users:[users.tier3.web]demo_udp_msg


    No problem, got the address/domain prompt.

    Now I logged into my DSL/NAT router and forwarded port 1234
    to my office PC client NAT'ed address (a 192.168.x.x address).

    > 3) Enter the IP address of your client node. Your "stock-monitor" from step
    > 1 should now spring into life with ransom stock-prices generated at 2sec
    > intervals. (NATed clients will find this bit problematic :-)


    Entered my dyndns-domain for my office DSL router.
    Worked like charm... :-)

    Stock prices begun to arrive and the "Tier3 Messages"
    popup poped up...

    >
    > 4) Enter any adhoc messages that you wish to appear in the seperate Java
    > Frame on the client.


    Yep, just a few 10's of a second delay from Deathrow to my
    "Tier3 Messages" popup. Nice.

    I'm using a public ISP in Sweden, b.t.w...

    What is the "Bid for the Stock" button supposed to do ?

    Jan-Erik.

  4. Re: Example: VMS to Web Browser "push" technology

    Hi David,

    wrote in message
    news:g7ep32$h9u$1@south.jnrs.ja.net...
    > In article , "Richard Maher"

    writes:
    > >Hi,
    > >
    > >3) Enter the IP address of your client node. Your "stock-monitor" from

    step
    > >1 should now spring into life with ransom stock-prices generated at 2sec
    > >intervals. (NATed clients will find this bit problematic :-)
    > >

    > I knew the government suspected shorters of spreading rumours etc to trash
    > companies stock prices but ransoming stock prices is taking it to a whole

    new
    > level
    >


    It was a genuine typo, but maybe it makes more sense these days with the two
    star players being Negative Equity and Margin Call :-)

    Cheers Richard Maher

    >
    > David Webb
    > Security team leader
    > CCSS
    > Middlesex University




  5. Re: Example: VMS to Web Browser "push" technology

    Hi Jan-Erik,

    > OK, tested sucessfuly. Some comments below.


    Thanks. I knew I could rely on you.

    > Interesting... :-)


    Don't forget that with subnets you can also use the UDP "broadcast"
    capability (and not have to subscribe directly to the server at all) and
    Multicasting would be even better (If you are using Signed-Applets or
    stand-alone applications on the client. Why an UNsigned-applet can't join a
    Multicast group and receive messages from the codebase is a mystery to me.)

    > Now I logged into my DSL/NAT router and forwarded port 1234
    > to my office PC client NAT'ed address (a 192.168.x.x address).


    You're a champion! Thanks for letting me know, I'll pass it on to someone
    else who was asking.

    > Entered my dyndns-domain for my office DSL router.
    > Worked like charm... :-)
    >
    > Stock prices begun to arrive and the "Tier3 Messages"
    > popup poped up...


    Result!

    > Yep, just a few 10's of a second delay from Deathrow to my
    > "Tier3 Messages" popup. Nice.
    >
    > I'm using a public ISP in Sweden, b.t.w...


    Yep, I have to admit to being impressed with the performance of traffic
    emanating from a crappy VAX (in Florida I believe?) A more impressive
    demonstration being the auto-suggest for the VMS Queue Names in
    http://manson.vistech.net/t3$examples/demo_client_web.html but this is still
    pretty cool nonetheless! Just goes to show what can be achieved when all the
    http/webserver/interpreter/process-management crud is removed.

    > What is the "Bid for the Stock" button supposed to do ?


    It's just a stub to say "This is where you'd put the code to do something
    useful". It is also a demonstration of how the Event Dispatching Thread
    (EDT) has not been blocked or hindered by the behind the scenes stock-price
    and message processing!

    In a real-world example I'd see things happening something like this: -

    .. You'd logon to your Tier3 application as illustrated in
    http://manson.vistech.net/t3$examples/demo_client_flash.html
    .. Your server application would offer Message-Subscription as one of it's
    services and tell a detached VMS process to include your client's IP
    Address/port in its list of customers
    .. Your user is now free to perform normal Application-X processing
    .. If the user sees something like a stock-price that they want to bid on,
    they click on the button and the buy/sell order is sent via your Tier3 pipe.
    .. UDP messages having no SSL protection or sequencing or reliability
    gurantees. things such as Sequence Numbers, Heart Beats etc need to be
    incorporated into the design
    .. OPCOM or adhoc messages are relayed to all users/subscribers by sending
    the messages via a mailbox to the local VMS detached process

    Obviously the above is just one suggestion, and I didn't wish to clutter up
    a simple example with application-specific idiosyncrasies, so what I tried
    to convey with DEMO_UDP_MSG.COB is just how easy this is from the VMS side,
    and with Tier3Pager.java and Tier3Talk.java just how easy the client side is
    to develope! Stock-Prices? Chat-Sessions? WhiteBoards? OPCOM messages? It's
    all good! And you don't need Tier3 (or any other middleware at all) to
    obtain this functionality. Obviously the sensible among you will see where
    Tier3 comes in (Click that button :-) but it is an option pack.

    In a nutshell, UDP tells you when there is something to do, and your Tier3
    TCP/IP persistent connection is used to verify what's going on and perform
    the work if need be.

    Obviously with Intranets, or now more importantly with IPsec, a whole lot
    more in the way of functionality and options is available to all of us!

    Cheers Richard Maher

    "Jan-Erik Söderholm" wrote in message
    news:FjCmk.1547$U5.901@newsb.telia.net...
    > OK, tested sucessfuly. Some comments below.
    >
    > Interesting... :-)
    >
    > Best Regards,
    > Jan-Erik.
    >
    > Richard Maher wrote:
    > > Hi,
    > >
    > > If you'd like to see an example of a bog-standard VMS server that sends

    UDP
    > > messages to Web-client subscribers, then please follow these

    instructions: -
    > >
    > > 1) Click on the following link and read the instructions:
    > > http://manson.vistech.net/~tier3/tier3pager.html

    >
    > OK, that bringed up the "Tier3 push Integration Demo" page in
    > a new tab in my Firefox. So far so good...
    >
    > > 2) Telnet to manson.vistech.net. (If you don't already have an account

    on
    > > the Deathrow cluster then please use Username: DEMO Password: USER) and
    > > then:
    > >
    > > $set term/width=132
    > > $run sys$users:[users.tier3.web]demo_udp_msg

    >
    > No problem, got the address/domain prompt.
    >
    > Now I logged into my DSL/NAT router and forwarded port 1234
    > to my office PC client NAT'ed address (a 192.168.x.x address).
    >
    > > 3) Enter the IP address of your client node. Your "stock-monitor" from

    step
    > > 1 should now spring into life with ransom stock-prices generated at 2sec
    > > intervals. (NATed clients will find this bit problematic :-)

    >
    > Entered my dyndns-domain for my office DSL router.
    > Worked like charm... :-)
    >
    > Stock prices begun to arrive and the "Tier3 Messages"
    > popup poped up...
    >
    > >
    > > 4) Enter any adhoc messages that you wish to appear in the seperate Java
    > > Frame on the client.

    >
    > Yep, just a few 10's of a second delay from Deathrow to my
    > "Tier3 Messages" popup. Nice.
    >
    > I'm using a public ISP in Sweden, b.t.w...
    >
    > What is the "Bid for the Stock" button supposed to do ?
    >
    > Jan-Erik.




  6. Re: Example: VMS to Web Browser "push" technology

    Richard Maher wrote:

    > ...and tell a detached VMS process to include your client's IP
    > Address/port in its list of customers


    Yes, I was thinking about that part. How the client
    would "subscribe" to the information.

    I'm seeing a "factory dashboard" application
    showing "daily production" typ of info. Makes
    upper management happy... :-)

    B.t.w, I'm not updated on the actual UDP vs. TCP
    differences. Was there some special reason to use UDP ?
    Whould it be harder (more complex) to use TCP instead ?

    Jan-Erik.


  7. Re: Example: VMS to Web Browser "push" technology

    Hi Jan-Erik,

    > Yes, I was thinking about that part. How the client
    > would "subscribe" to the information.


    The method I described is pretty standard, where the service-provider keeps
    a track of registered clients and distributes any incoming data to the list
    in a round-robin fashion. (Subscriptions usually have to be renewed every N
    mins)

    One alternative could be that, for every Tier3 client that logs-on, you keep
    a list of VMS Usernames and IP addresses(+/- ports) in a system-wide
    database that can be accessed by utilities such as $REPLY/USER or "You've
    got new mail" or "Your print job is finished" or "Fred wants to chat" or
    whatever. . .

    A totally different method of "subscribing" is (with, I believe, the
    restriction of only being available via subnets) to UDP "broadcast" messages
    to all clients that subscribe to a particular IP address. In this case the
    server, or service provider, has no knowledge of who the clients are (and
    quite frankly doesn't give a toss :-) Furthermore, and as alluded to in my
    previous post, "Multicasting" is the mutt's nut's for wide-area message
    dissemination, but there appear to be some real obstacles with public
    networks.

    > I'm seeing a "factory dashboard" application
    > showing "daily production" typ of info. Makes
    > upper management happy... :-)


    Look, polling is anathema to me but let's give the devil his due; if *every*
    movement in *every* instrument is to become a broadcastable event then
    you're not gonna be doing much else but servicing redundant, stale event
    data. I'm guessing that polling, at a user-configured interval, for a whole
    bag-full of statistics might suit your dashboard better - a la mode de
    RMU/SHOW STATS. Alarm-processing OTOH lends itself beautifully to the
    unsolicited and asynchronous capabilities of my example! Stall-Messages?
    Disk Statii? Cluster State transitions? All good stuff!

    > B.t.w, I'm not updated on the actual UDP vs. TCP
    > differences. Was there some special reason to use UDP ?
    > Whould it be harder (more complex) to use TCP instead ?


    At least you're honest! (And you're hardly going to be enlightened at a
    Bootcamp soiree for the under-utilized and overpaid. But then you did get
    your beloved gSOAP so I guess you're happy, even though the rest of us are
    dying for want of a XHR$ RTL :-( Argh. . .the bitterness consumes me!)

    Here's a few differentiators that might interest you (Hopefully others will
    chime in, and I'm sure there are oodles of white-papers from the IMM team et
    al, on what you should be doing with your IP network)

    1) TCP/IP is a connection-oriented, reliable protocol for delivering streams
    of data
    2) UDP is an unreliable connectionless protocol for delivering data packets
    in no guranteed sequence or without duplication/loss
    3) SSL can be layered on TCP/IP but not UDP (Lovely IPsec covers it all!)
    4) Because UDP is connectionless, any number of servers can supply data
    simultaneously
    5) With UDP you often need to use sequence number checks, heartbeats, and
    timeouts to maintain pseudo-connections
    6) TCP/IP is reliable, robust, let's you know when the peer dies and also
    has OOB data

    In a nutshell, a context-rich, connection-oriented protocol like TCP/IP (or
    DECnet for that matter) under the control of Tier3 Client/Server Middleware
    is the best fit for clients who want to simply "logon" and maintain a
    context-rich session with their chosen application(s). UDP is best suited to
    delivering asynchronous, and pehaps unsolicited, data into the equation.
    Alles klar?

    If OTOH you'd like to listen to every pointless knobhead in the industry,
    then you may well come to the conclusion that: -
    1) There is no benefit in maintaining a persitent connection between client
    and server because who's to say that you'll want to visit that same server
    again anyway? Somewhere between show balance/make withdrawl?
    2) Session Ids, Cookies, and waving a dead-chicken over your head, are more
    than adequate mechanisms for maintaining the barest minimum of state
    information 'cos anything else wouldn't be truly RESTful.
    3) Session hijacking isn't important.
    4) OTOH a persistent connection *is ideal* for asynchronous message
    broadcasts - Disbelief!
    5) Much better than polling, long-polling, streaming, cometting, chunking,
    and plain-bull****ting!
    6) HTTP "standard" says maximum of 2 connections per server but "vie have
    vays" of defeating such controls (Just like the cross-domain Ajax check!)
    7) Just because, at the end of the day, we have a dedicated connection and a
    dedicated server process per each client doesn't mean that we should have
    just stuck with INETd
    8) HTTP is just the most bestest, highest performing, and secure midlleware
    backbone for all your application needs
    9) Anyway, we own port 80 and anything else means you have to modify your
    Firewalls. Nah nah nanah-nah!

    Anyway, the Olympics beckon. . .

    Cheers Richard Maher

    PS. mysql, interpretters, Perl, Python, PHP, Linux - It's all good; Just
    what has VMS got to do with all this?

    "Jan-Erik Söderholm" wrote in message
    news:z5Rmk.1563$U5.857@newsb.telia.net...
    > Richard Maher wrote:
    >
    > > ...and tell a detached VMS process to include your client's IP
    > > Address/port in its list of customers

    >
    > Yes, I was thinking about that part. How the client
    > would "subscribe" to the information.
    >
    > I'm seeing a "factory dashboard" application
    > showing "daily production" typ of info. Makes
    > upper management happy... :-)
    >
    > B.t.w, I'm not updated on the actual UDP vs. TCP
    > differences. Was there some special reason to use UDP ?
    > Whould it be harder (more complex) to use TCP instead ?
    >
    > Jan-Erik.
    >




  8. Re: Example: VMS to Web Browser "push" technology

    Hi again,

    > 2) Telnet to manson.vistech.net. (If you don't already have an account on
    > the Deathrow cluster then please use Username: DEMO Password: USER) and
    > then:
    >
    > $set term/width=132
    > $run sys$users:[users.tier3.web]demo_udp_msg
    >


    For those of you who have tried, please let me point out that you cannot use
    the DEMO username on MANSON to access either: -
    http://manson.vistech.net/t3$examples/demo_client_web.html
    or
    http://manson.vistech.net/t3$examples/demo_client_flash.html
    as a RighsList identifier (TIER3_QUEUE_DEMO) is needed for access. To view
    those two examples you need to use the following credentials: -

    Username: TIER3_DEMO
    Password: QUEUE

    Your existing account (or the DEMO account) is valid for running (and
    viewing) the "pusher" part of the push-technology demonstration as well as
    T3$EXAMPLES. Sorry for the confusion.

    Cheers Richard Maher

    PS. If you're a Hobbyist and would much prefer to try this stuff out on your
    own boxes, then please contact me for a Hobbyist installation kit. (An
    updated version of which we hope to cut this week)


    "Richard Maher" wrote in message
    news:g7g0i0$qm1$1@news-01.bur.connect.com.au...
    > Hi Jan-Erik,
    >
    > > OK, tested sucessfuly. Some comments below.

    >
    > Thanks. I knew I could rely on you.
    >
    > > Interesting... :-)

    >
    > Don't forget that with subnets you can also use the UDP "broadcast"
    > capability (and not have to subscribe directly to the server at all) and
    > Multicasting would be even better (If you are using Signed-Applets or
    > stand-alone applications on the client. Why an UNsigned-applet can't join

    a
    > Multicast group and receive messages from the codebase is a mystery to

    me.)
    >
    > > Now I logged into my DSL/NAT router and forwarded port 1234
    > > to my office PC client NAT'ed address (a 192.168.x.x address).

    >
    > You're a champion! Thanks for letting me know, I'll pass it on to someone
    > else who was asking.
    >
    > > Entered my dyndns-domain for my office DSL router.
    > > Worked like charm... :-)
    > >
    > > Stock prices begun to arrive and the "Tier3 Messages"
    > > popup poped up...

    >
    > Result!
    >
    > > Yep, just a few 10's of a second delay from Deathrow to my
    > > "Tier3 Messages" popup. Nice.
    > >
    > > I'm using a public ISP in Sweden, b.t.w...

    >
    > Yep, I have to admit to being impressed with the performance of traffic
    > emanating from a crappy VAX (in Florida I believe?) A more impressive
    > demonstration being the auto-suggest for the VMS Queue Names in
    > http://manson.vistech.net/t3$examples/demo_client_web.html but this is

    still
    > pretty cool nonetheless! Just goes to show what can be achieved when all

    the
    > http/webserver/interpreter/process-management crud is removed.
    >
    > > What is the "Bid for the Stock" button supposed to do ?

    >
    > It's just a stub to say "This is where you'd put the code to do something
    > useful". It is also a demonstration of how the Event Dispatching Thread
    > (EDT) has not been blocked or hindered by the behind the scenes

    stock-price
    > and message processing!
    >
    > In a real-world example I'd see things happening something like this: -
    >
    > . You'd logon to your Tier3 application as illustrated in
    > http://manson.vistech.net/t3$examples/demo_client_flash.html
    > . Your server application would offer Message-Subscription as one of it's
    > services and tell a detached VMS process to include your client's IP
    > Address/port in its list of customers
    > . Your user is now free to perform normal Application-X processing
    > . If the user sees something like a stock-price that they want to bid on,
    > they click on the button and the buy/sell order is sent via your Tier3

    pipe.
    > . UDP messages having no SSL protection or sequencing or reliability
    > gurantees. things such as Sequence Numbers, Heart Beats etc need to be
    > incorporated into the design
    > . OPCOM or adhoc messages are relayed to all users/subscribers by sending
    > the messages via a mailbox to the local VMS detached process
    >
    > Obviously the above is just one suggestion, and I didn't wish to clutter

    up
    > a simple example with application-specific idiosyncrasies, so what I tried
    > to convey with DEMO_UDP_MSG.COB is just how easy this is from the VMS

    side,
    > and with Tier3Pager.java and Tier3Talk.java just how easy the client side

    is
    > to develope! Stock-Prices? Chat-Sessions? WhiteBoards? OPCOM messages?

    It's
    > all good! And you don't need Tier3 (or any other middleware at all) to
    > obtain this functionality. Obviously the sensible among you will see where
    > Tier3 comes in (Click that button :-) but it is an option pack.
    >
    > In a nutshell, UDP tells you when there is something to do, and your Tier3
    > TCP/IP persistent connection is used to verify what's going on and perform
    > the work if need be.
    >
    > Obviously with Intranets, or now more importantly with IPsec, a whole lot
    > more in the way of functionality and options is available to all of us!
    >
    > Cheers Richard Maher
    >
    > "Jan-Erik Söderholm" wrote in message
    > news:FjCmk.1547$U5.901@newsb.telia.net...
    > > OK, tested sucessfuly. Some comments below.
    > >
    > > Interesting... :-)
    > >
    > > Best Regards,
    > > Jan-Erik.
    > >
    > > Richard Maher wrote:
    > > > Hi,
    > > >
    > > > If you'd like to see an example of a bog-standard VMS server that

    sends
    > UDP
    > > > messages to Web-client subscribers, then please follow these

    > instructions: -
    > > >
    > > > 1) Click on the following link and read the instructions:
    > > > http://manson.vistech.net/~tier3/tier3pager.html

    > >
    > > OK, that bringed up the "Tier3 push Integration Demo" page in
    > > a new tab in my Firefox. So far so good...
    > >
    > > > 2) Telnet to manson.vistech.net. (If you don't already have an account

    > on
    > > > the Deathrow cluster then please use Username: DEMO Password: USER)

    and
    > > > then:
    > > >
    > > > $set term/width=132
    > > > $run sys$users:[users.tier3.web]demo_udp_msg

    > >
    > > No problem, got the address/domain prompt.
    > >
    > > Now I logged into my DSL/NAT router and forwarded port 1234
    > > to my office PC client NAT'ed address (a 192.168.x.x address).
    > >
    > > > 3) Enter the IP address of your client node. Your "stock-monitor" from

    > step
    > > > 1 should now spring into life with ransom stock-prices generated at

    2sec
    > > > intervals. (NATed clients will find this bit problematic :-)

    > >
    > > Entered my dyndns-domain for my office DSL router.
    > > Worked like charm... :-)
    > >
    > > Stock prices begun to arrive and the "Tier3 Messages"
    > > popup poped up...
    > >
    > > >
    > > > 4) Enter any adhoc messages that you wish to appear in the seperate

    Java
    > > > Frame on the client.

    > >
    > > Yep, just a few 10's of a second delay from Deathrow to my
    > > "Tier3 Messages" popup. Nice.
    > >
    > > I'm using a public ISP in Sweden, b.t.w...
    > >
    > > What is the "Bid for the Stock" button supposed to do ?
    > >
    > > Jan-Erik.

    >
    >




  9. Re: Example: VMS to Web Browser "push" technology

    In article , "Richard Maher" writes:

    > Just goes to show what can be achieved when all the
    > http/webserver/interpreter/process-management crud is removed.


    I couldn't resist enduring some crud-wading to demonstrate an
    alternate approach (AJAX polling), the example can be seen at:

    http://deathrow.vistech.net/~spider/ajaxpoll.html


  10. Re: Example: VMS to Web Browser "push" technology

    Graham Burley wrote:
    > In article , "Richard Maher" writes:
    >
    >> Just goes to show what can be achieved when all the
    >> http/webserver/interpreter/process-management crud is removed.

    >
    > I couldn't resist enduring some crud-wading to demonstrate an
    > alternate approach (AJAX polling), the example can be seen at:
    >
    > http://deathrow.vistech.net/~spider/ajaxpoll.html
    >


    Nice...

    I get aprox 500 ms refresh time.
    This is in Sweden behind a 2 Mb DSL line
    using a Zyxel DSL modem/router/firewall.

    Would it be possible to in short summarize
    the CONF file setting in WAST to run this server
    script ? How the "script reuse" is setup ?

    Jan-Erik.

  11. Re: Example: VMS to Web Browser "push" technology

    In article , =?ISO-8859-1?Q?Jan-Erik_S=F6derholm?= writes:

    >Would it be possible to in short summarize
    >the CONF file setting in WAST to run this server
    >script ? How the "script reuse" is setup ?


    The set-up on Deathrow is a bit odd since we allow user scripting
    (where the script executes under the users username) so that users
    can experiment at their own risk. That said there's nothing special
    about this script (i.e. you'd configure the same as any other),
    and iirc DCL script process re-use is the default WASD setting.


  12. RE: Example: VMS to Web Browser "push" technology

    > -----Original Message-----
    > From: Graham Burley [mailto:burley@Encompasserve.org]
    > Sent: August 13, 2008 7:13 AM
    > To: Info-VAX@Mvb.Saic.Com
    > Subject: Re: Example: VMS to Web Browser "push" technology
    >
    > In article , "Richard Maher"
    > writes:
    >
    > > Just goes to show what can be achieved when all the
    > > http/webserver/interpreter/process-management crud is removed.

    >
    > I couldn't resist enduring some crud-wading to demonstrate an
    > alternate approach (AJAX polling), the example can be seen at:
    >
    > http://deathrow.vistech.net/~spider/ajaxpoll.html



    Neat. In the time honoured tradition of stealing^Jborrowing code I do not
    understand and hacking until something happens, here is a MONITOR PROCESS
    for people who prefer HTML over text screens.

    You can monitor PROCESS/TOPCPU, PROCESS/TOPFAULT, PROCESS/TOPBIO or
    PROCESS/TOPDIO by selecting the button from the bottom of the page. A few
    seconds after if first starts you will see MONITOR PROCESS/TOPCPU by
    default. The top of the page will always show the screen with no data, you
    have to scroll down to get to the real data.

    ******** WARNING **********
    On my system a new sub-process is created every time the screen refreshes. I
    am not sure if there is a tweak I can do to change Apache to reuse the
    original process. If anyone knows of a way to do it then let me know,
    otherwise watch that you do not fill a disk with accounting data by leaving
    this page open.
    ******** WARNING **********


    $ create apache$common:[cgi-bin]monitor.com
    $deck
    $ write sys$output "Cache-Control: no-cache, must-revalidate"
    $ write sys$output "Expires: Mon, 26 Jul 1997 05:00:00 GMT"
    $ write sys$output "Content-Type: text/plain"
    $!
    $ write sys$output ""
    $ write sys$output "
    "
    $ monitor process/end="+00:00:03"/inter=1 /'query_string'
    $ write sys$output "
    "
    $ exit
    $eod
    $ create apache$common:[htdocs]monitor.html
    "http://www.w3.org/TR/html4/loose.dtd">




    Monitor in AJAX




    This example demonstrates using AJAX to show the output from the
    MONITOR PROCESS command. The text directly below this will show the
    standard MONITOR output with no data, scroll down and you should see
    the MONITOR output with live data. The live data should refresh itself
    every few seconds. Scroll down further to select another item to monitor
    using the buttons.




    stuff should appear here if your browser supports AJAX ...




    onClick="toggle_refresh()">


    onClick="get_stuff(this.id)">
    onClick="get_stuff(this.id)">
    onClick="get_stuff(this.id)">
    onClick="get_stuff(this.id)">



    $!



    Peter Weaver
    www.weaverconsulting.ca www.openvmsvirtualization.com
    www.vaxvirtualization.com www.alphavirtualization.com
    Winner of the 2007 OpenVMS.org Readers' Choice Award for
    System Management/Performance




  13. RE: Example: VMS to Web Browser "push" technology

    In article <0bd501c8fda5$72137c90$2802a8c0@CHARONLAP>, "Peter Weaver" writes:

    >$ monitor process/end="+00:00:03"/inter=1 /'query_string'


    You should never use (substitute) a query string like this, it's not safe.


  14. Re: Example: VMS to Web Browser "push" technology

    Graham Burley wrote:
    > In article <0bd501c8fda5$72137c90$2802a8c0@CHARONLAP>, "Peter Weaver" writes:
    >
    >
    >>$ monitor process/end="+00:00:03"/inter=1 /'query_string'

    >
    >
    > You should never use (substitute) a query string like this, it's not safe.


    Amen!

    --
    Did you see the frightened ones?
    Did you hear the falling bombs?
    Did you ever wonder why we had to run for shelter when the
    promise of a brave new world unfurled beneath a clear blue sky?
    [Waters; The Wall]

  15. Re: Example: VMS to Web Browser "push" technology

    Mark Daniel wrote:
    > Graham Burley wrote:
    >> In article <0bd501c8fda5$72137c90$2802a8c0@CHARONLAP>, "Peter Weaver"
    >> writes:
    >>
    >>
    >>> $ monitor process/end="+00:00:03"/inter=1 /'query_string'

    >>
    >>
    >> You should never use (substitute) a query string like this, it's not
    >> safe.

    >


    Just as an example, what could you enter as "query_string"
    to make that command unsafe ?

    Jan-Erik.

  16. Re: Example: VMS to Web Browser "push" technology

    In article , =?ISO-8859-1?Q?Jan-Erik_S=F6derholm?= writes:

    >Just as an example, what could you enter as "query_string"
    >to make that command unsafe ?


    nodisplay/record=somefile_that_gets_trashed

    If the attacker has local access or the ability to place files on the
    system then an "@someinput" could be inserted into the query string.

    Whether it's really unsafe depends on the privileges the script account
    has, or the files it has write access to.


  17. RE: Example: VMS to Web Browser "push" technology

    > -----Original Message-----
    > From: Graham Burley [mailto:burley@Encompasserve.org]
    >
    > In article <0bd501c8fda5$72137c90$2802a8c0@CHARONLAP>, "Peter Weaver"
    > writes:
    >
    > >$ monitor process/end="+00:00:03"/inter=1 /'query_string'

    >
    > You should never use (substitute) a query string like this, it's not safe.


    Right I never thought of that but I do need to add a few IF statements in
    there to make it safe.

    Peter Weaver
    www.weaverconsulting.ca www.openvmsvirtualization.com
    www.vaxvirtualization.com www.alphavirtualization.com
    Winner of the 2007 OpenVMS.org Readers' Choice Award for
    System Management/Performance



  18. Re: Example: VMS to Web Browser "push" technology

    In article , "Richard Maher" writes:

    > [snip]


    Yes I do undertand the difference between push and pull, an I'm not a
    fan of polling either. The example was just that - an example. It seems
    to have provided you with an opportunity to discuss the benefits of
    push, that's no bad thing.

    As far as I can see, your push demo simply demonstrates that a java
    applet can receive and display UDP messages. Neat idea, but there's
    work to do (as you've described already in this thread) to produce a
    real world implementation. At the moment this seems to have nothing to
    do with Tier3, except that you might use this approach in conjunction
    with it. If you were using Tier3, and had an active TCP connection
    between client and server, why wouldn't you just push the messages down
    that connection?

    > But getting back to Graham's example, maybe he wanted to reply to Jan-Erik
    > as a solution to his "factory dashboard" requirement (and fair-enough too).


    Perhaps it is.

    I make no apologies for the quick and dirty example, that's one of the
    benefits (and drawbacks) of working with a web server. I think it's good
    that WASD has addressed issues like the process creation overhead, for
    stuff like this. If I was seriously thinking of doing this I would use
    WASDs CGIplus or RTEs to avoid the image activation and startup overheads
    completely.


+ Reply to Thread