Skip to main content
Participant
June 2, 2016
Question

How to close FME Connection on FMS server side

  • June 2, 2016
  • 1 reply
  • 309 views

Hello,

      I  met a  problem like this: When I use FME stream viedo to FMS Server ,I  want to validate the connection by the stream name like this(eg: roomid?username=abc&passwd=passwd),and close the the connection on server-side actionscript.  just like this:

application.onPublish = function (clientObj, streamObj){

       if(streamObj.name=="test"){

         var error = new Object();error.message = "NetStream.Publish.BadName";

        application.rejectConnection(clientObj, error);

  }

}

the rejectConnection does not work.

    This topic has been closed for replies.

    1 reply

    Participant
    June 3, 2016

    I tried this:

    Client.prototype.FCPublish = function( streamname )

    {

      // setup your stream and check if you want to allow this stream to be published

      if ( streamname=="123") // do some validation here

      {  

      this.call("onFCPublish", null, {code:"NetStream.Publish.BadName", description:streamname});

      }

    }

    It also does not work well.

    Why Fms Server give the NetStream.Publish.Start instead of NetStream.Publish.BadName?