portping

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2016 License: MIT Imports: 2 Imported by: 2

README

portping

A simple library and command line utility to ping ports

GoDoc Build Status

Usage

Ping port 80 of google.com 3 times:

portping -c 3 google.com 80

Output:

Starting to ping google.com:80 ...
google.com:80 [1] -> success
google.com:80 [2] -> success
google.com:80 [3] -> success

Works with named ports too, for example:

portping google.com http

See portping -h for all available options.

Download

Binaries for several platforms are available on SourceForge:

https://sourceforge.net/projects/portping/files/

Generate test coverage report

Run the commands:

go test -coverprofile cover.out
go tool cover -html=cover.out -o cover.html
open cover.html

See more info: https://blog.golang.org/cover

Documentation

Overview

Package portping provides simple functions to ping TCP ports. It also includes a simple command line interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ping

func Ping(network, address string, timeout time.Duration) error

Ping connects to the address on the named network, using net.DialTimeout, and immediately closes it. It returns the connection error. A nil value means success. For examples of valid values of network and address, see the documentation of net.Dial

func PingN

func PingN(network, address string, timeout time.Duration, count int, c chan<- error)

PingN calls Ping the specified number of times, and sends the results to the given channel.

Types

This section is empty.

Directories

Path Synopsis
cmd
portping
Command line interface to ping ports
Command line interface to ping ports

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL