Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanstowe/checksocket
very simple Raku function to test if a TCP socket is listening on a given address
https://github.com/jonathanstowe/checksocket
raku tcp-socket test
Last synced: 23 days ago
JSON representation
very simple Raku function to test if a TCP socket is listening on a given address
- Host: GitHub
- URL: https://github.com/jonathanstowe/checksocket
- Owner: jonathanstowe
- License: artistic-2.0
- Created: 2015-06-28T16:07:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T12:16:23.000Z (over 2 years ago)
- Last Synced: 2023-04-22T17:06:59.534Z (over 1 year ago)
- Topics: raku, tcp-socket, test
- Language: Raku
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# CheckSocket
![Build Status](https://github.com/jonathanstowe/CheckSocket/workflows/CI/badge.svg)
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