Example #1
0
 // public void iniciarConexao()
 // {
 //     _servidor = new Thread(() => IniciarServidor());
 //     _servidor.Start();
 // }
 public void IniciarServidor()
 {
     try
     {
         _server = new Server
         {
             Services = { Mensageiro.BindService(new GrpcMensageiroServerImpl(
                                                     _myName,
                                                     _receiveMessage,
                                                     _insertMessage
                                                     )) },
             Ports = { new ServerPort(_myIp, int.Parse(_myPort), ServerCredentials.Insecure) }
         };
         _server.Start();
         Console.ReadLine();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }