Results 1 to 2 of 2

Thread: I can't disconnect FME to reject publishing

  1. #1
    Join Date
    May 2015
    Posts
    7

    Unhappy I can't disconnect FME to reject publishing

    Using Flash Media Live Encoder, I can't disconnect FME to reject publishing.

    Like the following

    My code
    public class MyModule extends ModuleCore implements IModuleOnApp2, IModuleOnConnect, IModuleOnStream {
       
        public static void publish(IClient iClient, RequestFunction requestFunction, AMFDataList amfDataList) {
            sendClientOnStatusError(iClient, "NetStream.Publish.Rejected", "Rejected");
            iClient.setShutdownClient(true);
        }
    
        /*
            ~~~~~~~~~~~~~~~
            ~~~~~~~~~~~~~~~
        */
    
    }
    Log
    Wed Jun 24 2015 19:35:08 : Primary - Network Status: NetStream.Publish.Rejected error Rejected
    Wed Jun 24 2015 19:35:08 : Primary - Network Status: NetConnection.Connect.Closed status
    Wed Jun 24 2015 19:35:17 : Primary - Disconnected
    Wed Jun 24 2015 19:35:18 : Problem publishing at Primary Server. Unable to publish STREAM_NAME stream either due to Network Problem at server, the stream name being used is busy, or you are not authorized to publish to this server. Please check the network connection with server, try publishing with other stream name, or contact your FMS administrator for help.
    Why am I unable to disconnect immediately?

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    I'm not sure of the context by which you are attempting to reject the stream, but to obtain a more immediate response to the rejection you might try something similar to the following combination:
    sendClientOnStatusError(stream.getClient(), "NetStream.Publish.Rejected", "Stream Rejected");
    stream.getClient().rejectConnection();
    stream.getClient().setAcceptConnectionDescription("[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=authfailed");
    stream.getClient().setSendCloseOnRejectConnection(true);
    This resulted in the following in my tests almost immediately:
    Wed Jun 24 2015 11:47:34 : Primary - Network Command: onFCUnpublish
    Wed Jun 24 2015 11:47:34 : Primary - Stream[test] Status: NetStream.Unpublish.Success
    Wed Jun 24 2015 11:47:34 : Primary - Network Status: NetConnection.Connect.Closed status
    Wed Jun 24 2015 11:47:34 : Primary - Disconnected
    Wed Jun 24 2015 11:47:43 : Audio Encoding Stopped
    Wed Jun 24 2015 11:47:43 : Session Stopped
    Thanks,
    Matt

  3. #3
    Join Date
    May 2015
    Posts
    7

    Default

    Thanks, Matt.

    Where do you implement your code to reject publishing?

  4. #4
    Join Date
    May 2015
    Posts
    7

    Default

    I tried this code but not changed.

    public class MyModule extends ModuleCore implements IModuleOnApp2, IModuleOnConnect, IModuleOnStream {
       
        public static void publish(IClient iClient, RequestFunction requestFunction, AMFDataList amfDataList) {
            sendClientOnStatusError(iClient, "NetStream.Publish.Rejected", "Rejected");
            iClient.setShutdownClient(true);
            iClient.rejectConnection();
            iClient.setAcceptConnectionDescription("[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=authfailed");
            iClient.setSendCloseOnRejectConnection(true);
        }
    
        /*
            ~~~~~~~~~~~~~~~
            ~~~~~~~~~~~~~~~
        */
    
    }

Similar Threads

  1. Client disconnect on broadcaster disconnect
    By Kricken in forum Live Streaming and Encoders
    Replies: 1
    Last Post: 11-16-2014, 10:46 PM
  2. http flashplayer streaming disconnect not sending a disconnect to wowza
    By balajiswaroop in forum Media Players and Devices Discussion
    Replies: 1
    Last Post: 11-25-2013, 08:29 AM

Posting Permissions

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