Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleBroadcaster does not create a unique instance of BroadcasterConfig #720

Closed
hpihkala opened this issue Nov 2, 2012 · 0 comments
Closed
Labels

Comments

@hpihkala
Copy link

hpihkala commented Nov 2, 2012

In the wiki this is stated:

"A unique instance of BroadcasterConfig is always associated with a Broadcaster."

However org.atmosphere.util.SimpleBroadcaster does not create a new config instance. I'm getting the same BroadcasterConfig instance from all the SimpleBroadcasters.

In SimpleBroadcaster source:

    protected BroadcasterConfig createBroadcasterConfig(AtmosphereConfig config){
        BroadcasterConfig bc = (BroadcasterConfig) config.properties().get(BroadcasterConfig.class.getName());
        if (bc == null) {
            bc = new BroadcasterConfig(config.framework().broadcasterFilters(), config, false, getID());
            config.properties().put(BroadcasterConfig.class.getName(), bc);
        }
        return bc;
    }

Compare this to DefaultBroadcaster, which always creates a new BroadcasterConfig:

    protected BroadcasterConfig createBroadcasterConfig(AtmosphereConfig config) {
        return new BroadcasterConfig(config.framework().broadcasterFilters, config, getID());
    }
jfarcand added a commit that referenced this issue Nov 6, 2012
@jfarcand jfarcand closed this as completed Nov 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants