1

所以在我的学校作业中,我得到了一个框架程序。该程序可以在服务器模式和客户端模式下运行。

When run in server mode the program takes input from std::cin and outputs to std::cout
When run in client mode the program takes input from std::cin and outputs to std::cout

我想要做的是使用 C++ 代码将它们连接在一起,(尽管我也在另一个问题中询问如何在“Windows”中使用命名管道将它们通过管道传输)

所以我在想这样的事情:

std::iostream server_input_client_output, server_output_client_input
start server in a thread Server(server_input_client_output, server_output_client_input)
start client in main thread Client(server_output_client_input, server_input_client_output)

我不想重写整个骨架程序,我只想为服务器和客户端提供允许双向实时通信的有效输入。

有人知道吗?谢谢。

4

0 回答 0