README

CheckSocket

image i_github_com_jonathanstowe_checksocket_workflows_ci_badge_svg not found

A very simple Raku function to test if a TCP socket is listening on a given address or a UNIX domain socket on the specified path

Description

This module provides a very simple mechanism to determine whether something is listening on a TCP socket at the given port and address, or UNIX domain socket at a specified path. This is primarly for the convenience of testing where there may be a dependency on an external network service. For example:

 use Test;
 use CheckSocket;

 if not check-socket(80, "localhost") {
      skip-all "no web server";
     exit;
 }

# or

use Test;
use CheckSocket;

# Start some socket server concurrently
if wait-socket(80, "localhost") {
	# do some tests
}
else {
	skip-all "server didn't start in time";
}

Installation

You can install directly with zef:

# From the source directory

zef install .

# Remote installation

zef install CheckSocket

Support

Suggestions/patches are welcomed via github at

https://github.com/jonathanstowe/CheckSocket/issues

Licence

Please see the LICENCE file in the distribution

Ā© Jonathan Stowe 2015 - 2021

CheckSocket v0.0.9

very simple Raku function to test if a TCP or UNIX domain socket is listening on a given address

Authors

  • Jonathan Stowe

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • CheckSocket

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.