TcpConnection(XmppSession xmppSession, TcpConnectionConfiguration configuration) {
super(xmppSession, configuration);
this.tcpConnectionConfiguration = configuration;
xmppSession.getStreamFeaturesManager().addFeatureNegotiator(new rocks.xmpp.core.tls.SecurityManager(xmppSession, new StreamFeatureListener() {
@Override
public void negotiationStatusChanged(StreamFeatureEvent streamFeatureEvent) throws Exception {
if (streamFeatureEvent.getStatus() == StreamFeatureNegotiator.Status.SUCCESS) {
secureConnection();
}
}
}, configuration.isSecure()));
xmppSession.getStreamFeaturesManager().addFeatureNegotiator(new CompressionManager(xmppSession, new StreamFeatureListener() {
@Override
public void negotiationStatusChanged(StreamFeatureEvent streamFeatureEvent) {
if (streamFeatureEvent.getStatus() == StreamFeatureNegotiator.Status.SUCCESS) {
compressStream();
}