-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支持UNIX Domain socket吗? #268
Comments
支持。自定义协议的例子,tutorial-10里,就有uds的示例代码。 |
噢噢,这是srpc项目啊。你想到workflow的项目里看一下。srpc的server端肯定是支持的,client我看看能不能配uds地址。 |
我看了一下,RPCClientParams好像不支持传入sockaddr: struct RPCClientParams
{
RPCTaskParams task_params;
//host + port + is_ssl
std::string host;
unsigned short port;
bool is_ssl;
//or URL
std::string url;
std::string caller;
}; 这个我们可以考虑加一下。不过,一般来讲,uds的话自定义协议是不是就可以了,没必要用带IDL的rpc? |
嗯嗯,建议可以加下,我是认为使用自定义协议,那就得需要自己再封装socket,计划是找一个能有支持uds的rpc,这样可以减少一些代码维护和增加程序稳健性能 |
自定义协议不用封装socket的。你看看一下这个文档和实例: |
好的,我看看,谢谢~ |
@yongxiangzheng #include "workflow/UpstreamManager.h"
int main()
{
UpstreamManager::upstream_create_round_robin("uds-host-name", false);
UpstreamManager::upstream_add_server("uds-host-name", "/home/xxxxx/uds-service");
struct RPCClientParams params = RPC_CLIENT_PARAMS_DEFAULT;
params.host = "uds-host-name";
Example::SRPCClient client(¶ms);
} 而server端直接用start(const struct sockaddr *addr, socklen_t addrlen);这个函数启动server,服务的地址在/home/xxxxx/uds-service就可以了。 |
Workflow项目里关于upstream的文档:https://github.com/sogou/workflow/blob/master/docs/about-service-governance.md |
请问 支持UNIX Domain socket方式的进程间通讯吗?
The text was updated successfully, but these errors were encountered: