connect(&socket, SIGNAL(encrypted()), this, SLOT(socketInitialized()));
connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
#endif
+ connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
+ connect(this, SIGNAL(newSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)));
}
CoreNetwork::~CoreNetwork() {
#else
event->setTimestamp(QDateTime::currentDateTime().toUTC());
#endif
- coreSession()->eventManager()->sendEvent(event);
+ emit newEvent(event);
}
}
}
void CoreNetwork::socketInitialized() {
+qDebug() << "connected()";
Server server = usedServer();
#ifdef HAVE_SSL
if(server.useSsl && !socket.isEncrypted())
return;
}
+ emit newSocket(identity, localAddress(), localPort(), peerAddress(), peerPort());
+
// TokenBucket to avoid sending too much at once
_messageDelay = 2200; // this seems to be a safe value (2.2 seconds delay)
_burstSize = 5;