I want to test my server program,(let's call it A) i just made.
(我想测试我的服务器程序,(我叫它A)。)
So when A get executed by this command (所以当A被这个命令执行时)
$VALGRIND ./test/server_tests 2 >>./test/test.log
,it is blocked to listen for connection.After that, i want to connect to the server in A using
(,它被阻止侦听连接。之后,我想使用)
nc 127.0.0.1 1234 < ./test/server_file.txt
so A can be unblocked and continue.
(因此A可以被解除阻止并继续。)
The problem is i have to manually type these commands in two different terminals, since both of them block. (问题是我必须在两个不同的终端中手动键入这些命令,因为它们都阻塞了。)
I have not figured out a way to automated this in a single shell script. (我还没有找到一种在单个shell脚本中自动执行此操作的方法。)
Any help would be appreciated. (任何帮助,将不胜感激。)
ask by Van Teo Le translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…