testing remote stuff
This commit is contained in:
parent
1e05d4576d
commit
3c9ccaafeb
374 changed files with 10526 additions and 2037 deletions
|
|
@ -1,6 +1,6 @@
|
|||
using Insight.Domain.Interfaces;
|
||||
using Insight.Domain.Messages;
|
||||
using Insight.Domain.Messages.Agent;
|
||||
using Insight.Domain.Network;
|
||||
using Insight.Domain.Network.Agent.Messages;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
|
|
@ -11,19 +11,21 @@ public class SessionHandler : IMessageHandler<AgentSession>
|
|||
{
|
||||
public async ValueTask HandleAsync<TMessage>(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
|
||||
{
|
||||
if (message is InventoryRequest)
|
||||
switch (message)
|
||||
{
|
||||
var result = new SessionList();
|
||||
result.AddRange(GetSessions());
|
||||
case InventoryRequest:
|
||||
{
|
||||
var result = new Collection<Session>();
|
||||
result.AddRange(GetSessions());
|
||||
|
||||
await sender.SendAsync(result, cancellationToken);
|
||||
await sender.SendAsync(result, cancellationToken);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Session> GetSessions()
|
||||
{
|
||||
var query = NativeMethods.GetSessions();
|
||||
|
||||
var sessions = new List<Session>();
|
||||
|
||||
foreach (var s in NativeMethods.GetSessions())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue