|
@@ -10,7 +10,6 @@
|
|
|
MainServer::MainServer( InitDatei *zDat )
|
|
|
: Thread()
|
|
|
{
|
|
|
- sslServerThread = 0;
|
|
|
Network::Start( 100 );
|
|
|
std::cout << "MS: Verbindung mit Datenbank wird hergestellt...\n";
|
|
|
db = new MSDatenbank( zDat );
|
|
@@ -26,13 +25,20 @@ MainServer::MainServer( InitDatei *zDat )
|
|
|
aServer = new SSLServer();
|
|
|
aServer->setPrivateKeyPassword( zDat->zWert( "SSLPasswort" )->getText() );
|
|
|
aServer->setCertificateFile( zDat->zWert( "SSLCert" )->getText() );
|
|
|
+ std::cout << "using cert file " << zDat->zWert( "SSLCert" )->getText() << "\n";
|
|
|
aServer->setPrivateKeyFile( zDat->zWert( "SSLKey" )->getText() );
|
|
|
+ std::cout << "using private key " << zDat->zWert( "SSLKey" )->getText() << "\n";
|
|
|
std::cout << "MS: Starten des Admin Servers...\n";
|
|
|
if( !aServer->verbinde( (unsigned short)TextZuInt( zDat->zWert( "AdminServerPort" )->getText(), 10 ), 10 ) )
|
|
|
{
|
|
|
std::cout << "MS: Der Admin Server konnte nicht gestartet werden. Das Programm wird beendet.\n";
|
|
|
exit( 1 );
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ std::cout << "Admin Server Port: " << zDat->zWert( "AdminServerPort" )->getText() << "\n";
|
|
|
+ std::cout.flush();
|
|
|
+ }
|
|
|
end = 0;
|
|
|
InitializeCriticalSection( &cs );
|
|
|
if( zDat->zWert( "Aktiv" )->istGleich( "TRUE" ) )
|
|
@@ -44,8 +50,6 @@ MainServer::~MainServer()
|
|
|
{
|
|
|
ende();
|
|
|
serverSSL->trenne();
|
|
|
- if( sslServerThread )
|
|
|
- delete sslServerThread;
|
|
|
serverSSL->release();
|
|
|
server->trenne();
|
|
|
server->release();
|
|
@@ -64,6 +68,8 @@ void MainServer::runn()
|
|
|
{
|
|
|
SSLSKlient *klient;
|
|
|
klient = aServer->getKlient();
|
|
|
+ if( klient )
|
|
|
+ std::cout << "Neuer Admin Client verbunden.\n";
|
|
|
if( end && klient )
|
|
|
{
|
|
|
klient->trenne();
|
|
@@ -81,9 +87,7 @@ void MainServer::runn()
|
|
|
void MainServer::thread()
|
|
|
{
|
|
|
MainServer *ms = this;
|
|
|
- if( sslServerThread )
|
|
|
- delete sslServerThread;
|
|
|
- sslServerThread = new AsynchronCall( [ms]()
|
|
|
+ new AsynchronCall( [ms]()
|
|
|
{
|
|
|
while( ms->serverSSL->isConnected() )
|
|
|
{
|