fix(core): update

This commit is contained in:
2021-04-28 13:41:55 +00:00
parent d8044507ed
commit 260f000304
9 changed files with 269 additions and 42 deletions

View File

@ -31,13 +31,17 @@ const testSmartNetwork = new smartnetwork.SmartNetwork();
const run = async () => {
// measure average speed over a period of 5 seconds
// the structure of speedResult is self explanatory using TypeScript (or the linked TypeDoc above)
const speedResult = testSmartNetwork.getSpeed(5000);
const speedResult: smartnetwork.SpeedResult = testSmartNetwork.getSpeed(5000);
//
const isLocalPortAvailable: boolean = await testSmartNetwork.isLocalPortAvailable(1234);
// you can check for local ports before trying to bind to it from your nodejs program
const isLocalPortUnused: boolean = await testSmartNetwork.isLocalPortUnused(1234);
// you can run basic port checks on remote domains.
const isRemotePortAvailable: boolean = await testSmartNetwork.isRemotePortAvailable(
'google.com:80'
);
// just another way to call for the same thing as above
const isRemotePortAvailable: boolean = await testSmartNetwork.isRemotePortAvailable(
'google.com',
80