How to remove IMediaStream object from Wowza to avoid "Hit license limit for publish"

Hello,

Each time flash client calls:

ns = new NetStream();

ns.publish(“streamName”)

ns.close();

I see that Wowza creates IMediaStream object. And if I execute above code for five times - Wowza logs tell “Hit license limit for publishing streams.” I want to properly reuse or shutdown previous stream instances on Wowza side.

How can I achieve that?

I tried without success:

@Override

public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {

// bellow doesn’t really work

stream.shutdown();

stream.close();

stream.getClient().getAppInstance().getStreams().clearStreamName(streamName, stream);

}

Here is article which describes how to block new streams, but I need to clean old one instead.

https://www.wowza.com/docs/how-to-block-a-duplicate-publish-stream

Thank you,

Stan

Hi,

I want to properly reuse or shutdown previous stream instances on Wowza side.

Can you clarify more on your use case? If a playback client or publisher disconnects, Wowza should automatically destroy the stream without additional interaction. The license limit error is built-in as part of the verification process to see if a trial subscription is exceeding the license usage. Using a paid license key should not trigger the error you are seeing.

Michelle

Try it like this

IClient.setShutdownClient(true);

For example:

stream.getClient().setShutdownClient(true);

For HTTP streams, take a look at this guide:

How to control access to HTTP streams (cupertinostreaming, sanjosestreaming, smoothstreaming, mpegdashstreaming)

httpSession.rejectSession();

Regards,

Salvadore

Thank you for updating this post.

Salvadore

Hi,

When the audio source is muted (no audio packets coming in), but the video is still coming in, the connection would not be dropped by Wowza, but would instead be kept open. Are you looking to temporarily suspend --but not disconnect – a given stream if there is no audio?

Michelle

Right, I don’t have license limitation issue on production. My clients don’t disconnects during republish. Users may enable mic when they want to speak and mute then.

I worry if clients publish/unpublish streams too often - extra stream objects stays in Wowza memory.

I don’t want to drop client connection :slight_smile:

Thank you for reply,

There were no video data at my test case.

Let’s close this thread as not many users will encounter this