Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 用于双向IPC的RCF_C++_Ipc_Rcf - Fatal编程技术网

C++ 用于双向IPC的RCF

C++ 用于双向IPC的RCF,c++,ipc,rcf,C++,Ipc,Rcf,我在项目中使用RCF进行进程间通信。RCF中是否有创建双向通道的方法。我将在这两个进程中运行服务器和客户端。我能够与Win32 NamedPipes进行单向通信,这里是服务器 int main() { MyServiceImpl myServiceImpl; RCF::RcfServer server;//(RCF::TcpEndpoint("0.0.0.0", 50001)); server.addServerTransport(boost::shared_ptr<

我在项目中使用RCF进行进程间通信。RCF中是否有创建双向通道的方法。我将在这两个进程中运行服务器和客户端。我能够与Win32 NamedPipes进行单向通信,这里是服务器

int main()
{
    MyServiceImpl myServiceImpl;
    RCF::RcfServer server;//(RCF::TcpEndpoint("0.0.0.0", 50001));
    server.addServerTransport(boost::shared_ptr<RCF::I_ServerTransport>(new RCF::Win32NamedPipeServerTransport(("rcfchannel"))));
    server.bind<MyService>(myServiceImpl);
    server.bind<MyService>(myServiceImpl);
    server.start();
    server.waitForStopEvent();

    return 0;
}
intmain()
{
MyServiceImpl MyServiceImpl;
RCF::RcfServer server;//(RCF::TcpEndpoint(“0.0.0.0”,50001));
addServerTransport(boost::shared_ptr(新RCF::Win32NamedPipeServerTransport((“rcfchannel”));
绑定(myServiceImpl);
绑定(myServiceImpl);
server.start();
waitForStopEvent();
返回0;
}
其中MyService是它正在实现的服务

Client.cpp

int main()
{
    try
    {
        std::vector<std::string> v;
        v.push_back("one");
        v.push_back("two");
        v.push_back("three");

        std::cout << "Before:\n";
        std::copy(
            v.begin(), 
            v.end(), 
            std::ostream_iterator<std::string>(std::cout, "\n"));

        RcfClient<MyService>* m_service = new  RcfClient<MyService>(RCF::Win32NamedPipeEndpoint("rcfchannel"));
        m_service->reverse(v);
        std::cout << "\nAfter:\n";
        std::copy(
            v.begin(), 
            v.end(), 
            std::ostream_iterator<std::string>(std::cout, "\n"));
    }
    catch(const std::exception &e)
    {
        std::cout << "Caught exception:\n";
        std::cout << "Type: " << typeid(e).name() << "\n";
        std::cout << "What: " << e.what() << "\n";
    }

    return 0;
}
intmain()
{
尝试
{
std::向量v;
v、 推回(“一”);
v、 推回(“两”);
v、 推回(“三”);
标准::不能反转(v);
std::cout有帮助吗