Sha256: 351b6c469e26924def5e4e7e9cd8af62214a10d6c82256183cab0a5a14d8512c

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

module ServiceObjects
  class SendArpPackets
    attr_reader :arp_packet, :config

    def initialize(application, packet)
      @packet = packet
      @config = application.config
    end

    def call
      @i = 0

      Thread.new do
        while true
          print "\r The ARP packet has been sent successfully #{@i} times"
        end
      end

      while true
        @i += 1
        packet.to_w(config.interface)
        sleep config.delay
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ownlan-0.3.2 lib/ownlan/service_objects/send_arp_packets.rb
ownlan-0.3.0 lib/ownlan/service_objects/send_arp_packets.rb