I/O in concurrent program

前端 未结 2 942
臣服心动
臣服心动 2020-12-12 08:26

I\'m working on a concurrent program; it has two threads, one of which listens messages from a server and the other one sends messages to it. I need to obtain commands from

2条回答
  •  没有蜡笔的小新
    2020-12-12 08:27

    Some alternatives

    1. have your command dump all the messages that have occurred since the last invocation of the command. That way the output is finite.

    2. have your cli command monitor all traffic continuously until ctrl-c (or some other key combination) is pressed then it reverts back to your application's cli prompt.

    3. have your cli command send data to a file and monitor that with a tail type tool

提交回复
热议问题