stpingUser Manual

stping(1)

Name

stping — SOCK_STREAM echo ping client

Synopsis

stping 

[ -c count ] [ -i interval ] [ -t timeout ] [ -u factor ] host port

stping 

{ -h }

Description

stping is analog of ICMP ping for SOCK_STREAM. Messages are sent to a server, stpingd, which responds back to the stping client.

The client maintains a list of pending responses, and keeps runing statistics. This illustrates connectivity and latency.

Pending responses are removed either when a response is received, or on timeout. A checksum is included in the packet contents to detect corruption, and a sequence number is used to identify the order of responses.

SIGINFO causes current statistics to be written to stderr. The total statistics are also printed to stderr when pinging is complete.

Options

-c count

Specify the maximum number of ping messages to send. stping will enter culling mode after this number has been sent (see SIGINT below).

The default is 0, meaning to continue indefinitely. Negative values are not permitted.

-i interval

The interval between pings, specified in seconds.

The default is 0.5 meaning a ping is sent every 500ms.

-t timeout

The interval to time-out pending responses, specified in seconds.

The default is 5.0 meaning a pending response is timed-out after 5000ms. If a response then arrives, it is considered an error.

-u factor

The cull factor, given as a multiple of timeout. This is the length of time to wait for unanswered pings when culling for exit.

The default is 1.25.

-h

Print a quick reference to these options, and exit.

Exit Status

Exits >0 if an error occurs, or 0 on success.

Signals

SIGINT

An initial SIGINT causes stping to cease sending futher ping messages, and to enter a period of culling. Pending responses pings are either recieved (and accounted for), or time out. stping will exit when no pending responses remain.

If a further SIGINT signal is recieved whilst culling pending responses, then stping will exit immediately, as if all responses had timed out.

SIGINFO

Causes stping to print current statistics to stderr.

SIGALRM

Used internally.

Caveats

SIGINFO is not present on Linux.

Timing is ostensibly to millisecond resolution, but is in practice only accurate to the OS scheduler.

See Also

stpingd.

History

stpingd was designed and implemented by Katherine Flavel for Bubblephone Ltd.