-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (34 loc) · 1.42 KB
/
Program.cs
File metadata and controls
35 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.ServiceModel;
using ConsoleApplicationServer.Servicio;
namespace ConsoleApplicationServer
{
class Program
{
static void Main(string[] args)
{
var host = new ServiceHost(typeof(tabla_contenedor));
host.Open();
Console.WriteLine($"Servicio 1 iniciado en {host.Description.Endpoints[0].Address}");
while (!(host.State == CommunicationState.Opened)) { }
var host2 = new ServiceHost(typeof(buques));
host2.Open();
Console.WriteLine($"Servicio 2 iniciado en {host2.Description.Endpoints[0].Address}");
while (!(host2.State == CommunicationState.Opened)) { }
var host3 = new ServiceHost(typeof(clientes));
host3.Open();
Console.WriteLine($"Servicio 3 iniciado en {host3.Description.Endpoints[0].Address}");
while (!(host3.State == CommunicationState.Opened)) { }
var host4 = new ServiceHost(typeof(productos));
host4.Open();
Console.WriteLine($"Servicio 4 iniciado en {host4.Description.Endpoints[0].Address}");
while (!(host4.State == CommunicationState.Opened)) { }
Console.WriteLine("Presiona cualquier tecla para terminar el servicio");
Console.ReadLine();
//host.Close();
host2.Close();
host3.Close();
host4.Close();
}
}
}