From ed542ac45e00c9b2faa0b41f3c00de6e291e5678 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 1 Jan 2021 11:30:03 -0800 Subject: fixes #1345 Restructure the source tree This is not quite complete, but it sets the stage for other protocols (such as zmq or mqtt) to be added to the project. --- src/tools/nngcat/nngcat_async_test.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 src/tools/nngcat/nngcat_async_test.sh (limited to 'src/tools/nngcat/nngcat_async_test.sh') diff --git a/src/tools/nngcat/nngcat_async_test.sh b/src/tools/nngcat/nngcat_async_test.sh new file mode 100755 index 00000000..2b03e522 --- /dev/null +++ b/src/tools/nngcat/nngcat_async_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# +# Copyright 2018 Staysail Systems, Inc. +# Copyright 2018 Capitar IT Group BV +# +# This software is supplied under the terms of the MIT License, a +# copy of which should be located in the distribution where this +# file was obtained (LICENSE.txt). A copy of the license may also be +# found online at https://opensource.org/licenses/MIT. +# + +NNGCAT=${NNGCAT:=$1} +NNGCAT=${NNGCAT:-./nngcat} +ADDR="ipc:///tmp/nngcat_async_test" + +echo -n "Verify async connect: " + +${NNGCAT} --async -d 1 --connect ${ADDR} --req0 -D "ping" & + + +answer=$( ${NNGCAT} --rep0 --recv-timeout=3 --listen ${ADDR} -D "pong" --ascii 2>/dev/null ) + +if [[ ${answer} == "ping" ]] +then + echo "pass" + exit 0 +fi + +echo "Failed: req did not match" +echo "RES: $answer" +exit 1 -- cgit v1.2.3-70-g09d2