Exemplo n.º 1
0
 public void startService()
 {
     try
     {
         Console.WriteLine(Convert.ToInt32(this.CloudPort));
         server      = new transportServer(Convert.ToInt32(this.CloudPort));
         sockests    = new List <TcpClient>();
         reqListener = new transportServer.NewClientHandler(newClientRequest);
         msgListener = new transportServer.NewMsgHandler(newMessageRecived);
         server.OnNewClientRequest  += reqListener;
         server.OnNewMessageRecived += msgListener;
         if (server.isStarted())
         {
             addLog(this.logs, Constants.SERVICE_START_OK, Constants.LOG_INFO);
         }
         else
         {
             addLog(this.logs, Constants.SERVICE_START_ERROR, Constants.LOG_ERROR);
         }
     }
     catch
     {
         addLog(this.logs, Constants.SERVICE_START_ERROR, Constants.LOG_ERROR);
     }
 }
Exemplo n.º 2
0
 public bool isStarted()
 {
     if (server != null)
     {
         return(server.isStarted());
     }
     else
     {
         return(false);
     }
 }