Skip to main content
Participant
September 14, 2010
Question

limit the number of viewers per application

  • September 14, 2010
  • 1 reply
  • 537 views

How to limit the number of viewers per application

    This topic has been closed for replies.

    1 reply

    September 14, 2010

    You can check length of the application.clients array in every onConnect handler

    smilehostAuthor
    Participant
    September 15, 2010

    Thanks @Shadow_SB

    where is application.clients array

    Participating Frequently
    September 15, 2010

    It should be available by default on server-side AS.

    example

    application.onConnect = function(myclient){

         trace("Number of clients connected is:"+application.clients.length);

    }

    so what shadow_sb was saying is write code based on it say like

    if(application.clients.length > 50){

         application.rejectConnection(myclient);

    }