Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/08/16 17:02:06 (8 years ago)
Author:
thasling
Message:

prepared protoype for next meeting

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  
    4848  <ItemGroup>
    4949    <None Include="App.config" />
     50    <None Include="startServer.bat">
     51      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     52    </None>
    5053  </ItemGroup>
    5154  <ItemGroup>
  • branches/thasling/DistributedGA/DistributedGA.ContactServer.Host/Program.cs

    r13557 r13887  
    22using System.ServiceModel;
    33
    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.
     4namespace 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.
    1622
    1723
    18         // Open the ServiceHost to start listening for messages. Since
    19         // no endpoints are explicitly configured, the runtime will create
    20         // one endpoint per base address for each service contract implemented
    21         // 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.
    2228
    23         host.Open();
     29                host.Open();
    2430
    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();
    2834
    29         // Close the ServiceHost.
    30         host.Close();
    31       }
     35                // Close the ServiceHost.
     36                host.Close();
     37            }
     38        }
    3239    }
    33   }
    3440}
Note: See TracChangeset for help on using the changeset viewer.