Alpha Video Training
Results 1 to 3 of 3

Thread: Pushing message to users

  1. #1
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,806

    Default Pushing message to users

    Is there a way to push a message to a user without the user needing to refresh the screen? ...meaning if I am about to restart the app server I'd like to somehow make a message appear in real time at the top of a user's browser saying "Server rebooting in 5 minutes, save your work" ....the program I work on uses the tabbed ui component.

    I'm wondering if someone has done something like this.

    -Mike

  2. #2
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,315

    Default Re: Pushing message to users

    Server don't send messages to clients. The communication is one-way in terms of client-server connection. You would need to get all your clients to setup open ports on their systems to listen for messages from your server if you wanted to send messages. And you'd have to configure a port on your server to do the sending. And setup server scripts and stuff. And possibly contact your host provider and ask them to open a port in the firewall to let you send messages to your clients...

    But you can do what you need with some client-side scripts and a maintenance schedule.

    Record your scheduled maintenance times in a file or in your database - wherever you feel most comfortable putting the data. Put it somewhere, though, that you can get the data & store it client-side:

    1. When the page loads, get your maintenance schedule from the server (ajaxCallback).
    2. If maintenance is soon - within 30 minutes? - issue a warning right away that the server is undergoing maintenance @ "Time of server maintenance" and that they need to save now less they drama
    3. If maintenance is not soon, wait until however many min before scheduled maintenance and issue popup when it is soon (setTimeout(function, milliseconds))

    The count down script that's been floating around for warning people that their session has expired or is going to expire soon could be modified to do this: http://msgboard.alphasoftware.com/al...l=1#post645868

    Don't do something where you send an ajaxCallback to the server ever few minutes. DDoS and sessions that never expire lie down that path if done improperly.
    Alpha Anywhere latest pre-release

  3. #3
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Pushing message to users

    I use this javascript code to keep a session alive. You could do something similar with setInterval() to get a small file every so many minutes and if it loads then show a predefined message (alert()) for example to say that the server will be rebooted"

    Code:
    <!-- Keep session alive every 5 minutes -->
    <script type="text/javascript">
    setInterval(function() { var myelement = document.getElementById('myimg'); myelement.src = 'images/session.png?rand=' + Math.random(); }, 300000); 
    </script>
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

Similar Threads

  1. Can no longer add NEW USERS or change the PERMISSIONS of current users
    By Rich Hartnett in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 07-10-2012, 08:13 PM
  2. Overrule confirmation message in tabbed ui message
    By ruudluiten in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 12-18-2011, 08:53 AM
  3. Pushing data to an external database
    By om21 in forum Alpha Five Version 7
    Replies: 1
    Last Post: 05-14-2007, 10:22 PM
  4. Send a message to All Users
    By andymeer@yahoo.co.uk in forum Alpha Five Version 7
    Replies: 1
    Last Post: 12-03-2006, 05:42 PM
  5. Pushing Hotspots
    By John Oesterle in forum Alpha Five Version 4
    Replies: 6
    Last Post: 06-04-2000, 01:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •