Mercurial > hg > orthanc
comparison OrthancServer/main.cpp @ 685:b01cc78caba4
possibility to disable the DICOM/HTTP servers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 31 Jan 2014 17:45:27 +0100 |
parents | 96d8410c56cd |
children | 2d0a347e8cfc |
comparison
equal
deleted
inserted
replaced
684:96d8410c56cd | 685:b01cc78caba4 |
---|---|
400 else | 400 else |
401 { | 401 { |
402 httpServer.SetSslEnabled(false); | 402 httpServer.SetSslEnabled(false); |
403 } | 403 } |
404 | 404 |
405 LOG(WARNING) << "DICOM server listening on port: " << dicomServer.GetPortNumber(); | |
406 LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber(); | |
407 | |
408 #if ORTHANC_STANDALONE == 1 | 405 #if ORTHANC_STANDALONE == 1 |
409 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::ORTHANC_EXPLORER)); | 406 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::ORTHANC_EXPLORER)); |
410 #else | 407 #else |
411 httpServer.RegisterHandler(new FilesystemHttpHandler("/app", ORTHANC_PATH "/OrthancExplorer")); | 408 httpServer.RegisterHandler(new FilesystemHttpHandler("/app", ORTHANC_PATH "/OrthancExplorer")); |
412 #endif | 409 #endif |
413 | 410 |
414 httpServer.RegisterHandler(new OrthancRestApi(context)); | 411 httpServer.RegisterHandler(new OrthancRestApi(context)); |
415 | 412 |
416 // GO !!! | 413 // GO !!! Start the requested servers |
417 httpServer.Start(); | 414 if (GetGlobalBoolParameter("HttpServerEnabled", true)) |
418 dicomServer.Start(); | 415 { |
416 httpServer.Start(); | |
417 LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber(); | |
418 } | |
419 else | |
420 { | |
421 LOG(WARNING) << "The HTTP server is disabled"; | |
422 } | |
423 | |
424 if (GetGlobalBoolParameter("DicomServerEnabled", true)) | |
425 { | |
426 dicomServer.Start(); | |
427 LOG(WARNING) << "DICOM server listening on port: " << dicomServer.GetPortNumber(); | |
428 } | |
429 else | |
430 { | |
431 LOG(WARNING) << "The DICOM server is disabled"; | |
432 } | |
419 | 433 |
420 LOG(WARNING) << "Orthanc has started"; | 434 LOG(WARNING) << "Orthanc has started"; |
421 Toolbox::ServerBarrier(); | 435 Toolbox::ServerBarrier(); |
422 | 436 |
423 // Stop | 437 // We're done |
424 LOG(WARNING) << "Orthanc is stopping"; | 438 LOG(WARNING) << "Orthanc is stopping"; |
425 } | 439 } |
426 | 440 |
427 serverFactory.Done(); | 441 serverFactory.Done(); |
428 } | 442 } |