Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Terminating the server via RPC call #187

Open
@sasmaster

Description

@sasmaster

Hi.
I am not sure if it's a bug or my misunderstanding of documentation. I would like to terminate a process via rpc message. Now,the thing is ,there is rpc server loop which needs to be closed,right?

So I wrote a message handler like this:

   ```

rpc::server srv(rpc::constants::DEFAULT_PORT);
//Process terminate callback
srv.bind("close",
{
rpc::this_server_t server = rpc::this_server();
server.stop();
return 1;
});


Because a comment for rpc::this_server() states "A thread-local object that can be used to control
 the behavior of the server w.r.t. the handler." ,I assumed that I can use it to terminate the server and exit its loop.But that never happens.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions