Giter Club home page Giter Club logo

pingtool's Introduction

PingTool

A simple ping tool with customizable arguments for android

Simple Build

  • with default options

    Ping.Builder()

  • with more options

    Ping.Builder().addOption(Ping.OptionTimeout.apply { value = 5 })

  • build

    Ping.Builder().build()

  • clear options

    Ping.Builder().build().clearOption()

Build-in options

  • Ping.OptionInterval -- interval of ping
  • Ping.OptionCount -- count(s) of ping
  • Ping.OptionTimeout -- timeout of ping per count
  • Ping.OptionPackages -- packages of ping

Default options

  • Ping.OptionTimeout = 1
  • Ping.OptionCount = 1

Samples

// build pingTool with additional argument
val pingTool = Ping.Builder()
        .addOption(Ping.OptionTimeout.apply { value = 5 })  // timeout 5 seconds
        .build()

// chek pinging busy state
pingTool.isBusy

// set target host
pingTool.destination = "127.0.0.1"

// run synchronized with arguments from options builder
pingTool.runSync().also { pingResult ->
    // do stuff with pingResult
}

// or run synchronized with custom arguments
pingTool.runSync(" -i 200 ").also { pingResult ->
        // do stuff with pingResult
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.