Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanstowe/test-util-serverport
Get a free server port for testing with
https://github.com/jonathanstowe/test-util-serverport
network raku testing-tools
Last synced: 25 days ago
JSON representation
Get a free server port for testing with
- Host: GitHub
- URL: https://github.com/jonathanstowe/test-util-serverport
- Owner: jonathanstowe
- License: artistic-2.0
- Created: 2016-02-10T19:24:54.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T06:40:19.000Z (over 1 year ago)
- Last Synced: 2023-07-05T07:34:18.952Z (over 1 year ago)
- Topics: network, raku, testing-tools
- Language: Raku
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# Test::Util::ServerPort
Get a free server port for testing with
![Build Status](https://github.com/jonathanstowe/Test-Util-ServerPort/workflows/CI/badge.svg)
## Synopsis
```raku
use Test::Util::ServerPort;
my $port = get-unused-port();
# .. start some server with the port
```
## Description
This is a utility to help with the testing of TCP server software.
It exports a single subroutine ```get-unused-port``` that will return
a port number in the range 1025 - 65535 (or a specified range
as an argument,) that is free to be used by a listening socket. It
checks by attempting to ```listen``` on a random port on the range
until it finds one that is not already bound.## Installation
Assuming you have a working Rakudo installation you should be able to install this with *zef* :
# From the source directory
zef install .# Remote installation
zef install Test::Util::ServerPort
## Support
Suggestions and patches that may make it more useful in your software
are welcomed via github at:https://github.com/jonathanstowe/Test-Util-ServerPort
## Licence
This is free software.
Please see the [LICENCE](LICENCE) file in the distribution for details.
© Jonathan Stowe 2016 - 2021