- Timestamp:
- 06/08/16 17:02:06 (8 years ago)
- Location:
- branches/thasling/DistributedGA/DistributedGA.ContactServer.Host
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.ContactServer.Host/DistributedGA.ContactServer.Host.csproj
r13524 r13887 48 48 <ItemGroup> 49 49 <None Include="App.config" /> 50 <None Include="startServer.bat"> 51 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 52 </None> 50 53 </ItemGroup> 51 54 <ItemGroup> -
branches/thasling/DistributedGA/DistributedGA.ContactServer.Host/Program.cs
r13557 r13887 2 2 using System.ServiceModel; 3 3 4 namespace DistributedGA.ContactServer.Host { 5 class Program { 6 static void Main(string[] args) { 7 string baseAddress = string.Empty; 8 if (args.GetUpperBound(0) > -1) { 9 baseAddress = args[0]; 10 } 11 if (string.IsNullOrWhiteSpace(baseAddress)) { 12 baseAddress = "net.tcp://localhost:9090/DistributedGA.ContactServer/ContactService"; 13 } 14 using (ServiceHost host = new ServiceHost(typeof(ContactServiceImpl), new Uri[] { new Uri(baseAddress) })) { 15 // Enable metadata publishing. 4 namespace DistributedGA.ContactServer.Host 5 { 6 class Program 7 { 8 static void Main(string[] args) 9 { 10 string baseAddress = string.Empty; 11 if (args.GetUpperBound(0) > -1) 12 { 13 baseAddress = args[0]; 14 } 15 if (string.IsNullOrWhiteSpace(baseAddress)) 16 { 17 baseAddress = "net.tcp://localhost:9090/DistributedGA.ContactServer/ContactService"; 18 } 19 using (ServiceHost host = new ServiceHost(typeof(ContactServiceImpl), new Uri[] { new Uri(baseAddress) })) 20 { 21 // Enable metadata publishing. 16 22 17 23 18 // Open the ServiceHost to start listening for messages. Since19 // no endpoints are explicitly configured, the runtime will create20 // one endpoint per base address for each service contract implemented21 // by the service.24 // Open the ServiceHost to start listening for messages. Since 25 // no endpoints are explicitly configured, the runtime will create 26 // one endpoint per base address for each service contract implemented 27 // by the service. 22 28 23 host.Open();29 host.Open(); 24 30 25 Console.WriteLine("The service is ready at {0}", baseAddress);26 Console.WriteLine("Press <Enter> to stop the service.");27 Console.ReadLine();31 Console.WriteLine("The service is ready at {0}", baseAddress); 32 Console.WriteLine("Press <Enter> to stop the service."); 33 Console.ReadLine(); 28 34 29 // Close the ServiceHost. 30 host.Close(); 31 } 35 // Close the ServiceHost. 36 host.Close(); 37 } 38 } 32 39 } 33 }34 40 }
Note: See TracChangeset
for help on using the changeset viewer.