Exemplo n.º 1
0
        public override async Task <bool> ProcessItem(ServiceInput item)
        {
            var pingResult = await ScannersCommon.Ping(new PingInput
            {
                Address = item.Endpoint.Address,
                Retries = item.Retries,
                Timeout = item.Timeout
            });

            if (pingResult.Reply == null || pingResult.Reply.Status != IPStatus.Success)
            {
                return(false);
            }

            var scanResult = await ScannersCommon.IsPortOpen(new PortInput
            {
                Address = item.Endpoint.Address,
                Ports   = new List <int> {
                    item.Endpoint.Port
                },
                Retries = item.Retries,
                Timeout = item.Timeout
            }, portClient);

            return(scanResult[0].IsOpen);
        }
Exemplo n.º 2
0
 public override Task <PingResult> ProcessItem(PingInput item)
 {
     return(ScannersCommon.Ping(item));
 }
Exemplo n.º 3
0
 public override Task <List <PortResult> > ProcessItem(PortInput item)
 {
     return(ScannersCommon.IsPortOpen(item, portClient));
 }