Skip to content

Commit

Permalink
Added support for setting the listener ports via command line argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
anders9ustafsson committed Mar 2, 2017
1 parent d805c97 commit a283bed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 6 additions & 2 deletions Desktop/C-Store SCP/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ private static void Main(string[] args)
var dict = DicomDictionary.Default;


// start DICOM server on port 11112
var server = DicomServer.Create<CStoreSCP>(11112);
// start DICOM server on port from command line argument or 11112
int tmp;
var port = args != null && args.Length > 0 && int.TryParse(args[0], out tmp) ? tmp : 11112;
Console.WriteLine($"Starting C-Store SCP server on port {port}");

var server = DicomServer.Create<CStoreSCP>(port);


// end process
Expand Down
13 changes: 7 additions & 6 deletions Desktop/Print SCP/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ namespace Print_SCP
{
using System;

using Dicom;
using Dicom.Imaging;
using Dicom.Log;
using Dicom.Printing;

Expand All @@ -19,14 +17,17 @@ private static void Main(string[] args)

//This is a simple DICOM Print SCP implementation with Print Job and Send Event Report Support
//This sample depends on the Microsoft XPS Document Writer Printer to be installed on the system
//You are free to use what ever printer you like by modifieing the PrintJob DoPrint method hard coded
//You are free to use what ever printer you like by modifying the PrintJob DoPrint method hard coded
//printer name

//All print jobs willbe created to the exe folder under a folder named PrintJobs
//All print jobs will be created to the exe folder under a folder named PrintJobs

Console.WriteLine("Starting print SCP server with AET: PRINTSCP on port 8000");
int tmp;
var port = args != null && args.Length > 0 && int.TryParse(args[0], out tmp) ? tmp : 8000;

PrintService.Start(8000, "PRINTSCP");
Console.WriteLine($"Starting print SCP server with AET: PRINTSCP on port {port}");

PrintService.Start(port, "PRINTSCP");

Console.WriteLine("Press any key to stop the service");

Expand Down

0 comments on commit a283bed

Please sign in to comment.