示例#1
0
 private void Connection_ReceiveMessage(NamedPipeWrapper.NamedPipeConnection <RPAMessage, RPAMessage> connection, RPAMessage message)
 {
     try
     {
         if (message.command == "pong")
         {
             lastheartbeat = DateTime.Now;
             return;
         }
         Log.Information(message.command.ToString());
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
     }
 }
示例#2
0
文件: Program.cs 项目: max620/openrpa
 private static async void Pipe_ClientMessage(NamedPipeWrapper.NamedPipeConnection <RPAMessage, RPAMessage> connection, RPAMessage message)
 {
     try
     {
         if (message.command == "pong")
         {
             return;
         }
         if (message.command == "hello")
         {
             var windowsusername = message.windowsusername.ToLower();
             var session         = sessions.Where(x => x.client.windowsusername == windowsusername).FirstOrDefault();
             if (session == null)
             {
                 //Log.Information("Adding new unattendedclient for " + windowsusername);
                 string computername = NativeMethods.GetHostName().ToLower();
                 string computerfqdn = NativeMethods.GetFQDN().ToLower();
                 var    client       = new unattendedclient()
                 {
                     computername = computername, computerfqdn = computerfqdn, windowsusername = windowsusername, name = computername + " " + windowsusername, openrpapath = message.openrpapath
                 };
                 // client = await global.webSocketClient.InsertOne("openrpa", 1, false, client);
                 session = new RobotUserSession(client);
                 sessions.Add(session);
             }
             if (session.client != null)
             {
                 session.client.openrpapath = message.openrpapath;
                 session.AddConnection(connection);
             }
         }
         if (message.command == "reloadconfig")
         {
             await ReloadConfig();
         }
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
     }
 }
示例#3
0
 private void Connection_ReceiveMessage(NamedPipeWrapper.NamedPipeConnection <RPAMessage, RPAMessage> connection, RPAMessage message)
 {
     if (message.command == "pong")
     {
         lastheartbeat = DateTime.Now;
         return;
     }
     Log.Debug(message.command.ToString());
 }