• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Hi,How to set the maximum number of connections of FMS on the same IP

Explorer ,
Apr 10, 2012 Apr 10, 2012

Copy link to clipboard

Copied

How to set the maximum number of connections of FMS on the same IP?

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Apr 10, 2012 Apr 10, 2012

The application.clients object available in the server side action script maintains a list of all client connected to the instance at that moment.

You can traverse the array and compare the Client.ip property to determine the max connections coming from an ip and accordingly accept/reject connections.

It can be as simple as this in the application.onConnect,

application.onConnect = function(clientObj)

{

var totalConnections = 0;

for (i = 0; i < application.clients.length; i++)

{

If (application.clients[

...

Votes

Translate

Translate
Explorer ,
Apr 10, 2012 Apr 10, 2012

Copy link to clipboard

Copied

Please help me, I was impatient, I want the same IP to establish up to 10 RTMP connection

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 10, 2012 Apr 10, 2012

Copy link to clipboard

Copied

The application.clients object available in the server side action script maintains a list of all client connected to the instance at that moment.

You can traverse the array and compare the Client.ip property to determine the max connections coming from an ip and accordingly accept/reject connections.

It can be as simple as this in the application.onConnect,

application.onConnect = function(clientObj)

{

var totalConnections = 0;

for (i = 0; i < application.clients.length; i++)

{

If (application.clients[ip] == clientObj[ip])

{

totalConnections++;

}

}

If(totalConnections > 10)

this.rejectConnection(clientObj);

else

this.acceptConnection(clientObj);

}

Above piece of code is untested so you might be required to make some changes to make it work but your solution should look something like that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2012 Apr 10, 2012

Copy link to clipboard

Copied

LATEST

Great ideas, solve my problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines