this.cfg = cfg;
this.socketFactory = socketFactory;
if (cfg.isSubscriptionChannelSharingEnabled()) {
channelManager = new MultiplexHChannelManager(cfg, socketFactory);
} else {
channelManager = new SimpleHChannelManager(cfg, socketFactory);
}
pub = new HedwigPublisher(this);
sub = new HedwigSubscriber(this);
}