{"action":"created","issue":{"url":"https://api.github.com/repos/brpc/brpc/issues/461","repository_url":"https://api.github.com/repos/brpc/brpc","labels_url":"https://api.github.com/repos/brpc/brpc/issues/461/labels{/name}","comments_url":"https://api.github.com/repos/brpc/brpc/issues/461/comments","events_url":"https://api.github.com/repos/brpc/brpc/issues/461/events","html_url":"https://github.com/brpc/brpc/issues/461","id":352867579,"node_id":"MDU6SXNzdWUzNTI4Njc1Nzk=","number":461,"title":"使用brpc访问http服务，为何这么设计？","user":{"login":"RuhigSoda","id":23352452,"node_id":"MDQ6VXNlcjIzMzUyNDUy","avatar_url":"https://avatars3.githubusercontent.com/u/23352452?v=4","gravatar_id":"","url":"https://api.github.com/users/RuhigSoda","html_url":"https://github.com/RuhigSoda","followers_url":"https://api.github.com/users/RuhigSoda/followers","following_url":"https://api.github.com/users/RuhigSoda/following{/other_user}","gists_url":"https://api.github.com/users/RuhigSoda/gists{/gist_id}","starred_url":"https://api.github.com/users/RuhigSoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RuhigSoda/subscriptions","organizations_url":"https://api.github.com/users/RuhigSoda/orgs","repos_url":"https://api.github.com/users/RuhigSoda/repos","events_url":"https://api.github.com/users/RuhigSoda/events{/privacy}","received_events_url":"https://api.github.com/users/RuhigSoda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-22T09:14:21Z","updated_at":"2018-08-22T09:52:50Z","closed_at":null,"author_association":"NONE","body":"使用brpc访问http服务，初始化一个全局的channel，如下：\r\n\r\n```cpp\r\nbrpc::Channel channel;\r\nbrpc::ChannelOptions options;\r\noptions.protocol = brpc::PROTOCOL_HTTP;\r\noptions.timeout_ms = 100;\r\nstd::string url = \"http://test111.com\";\r\nif (channel.Init(url.c_str(), &options)) {\r\n    LOG_ERR(\"failed to init channel\");\r\n    return -1;\r\n}\r\n```\r\n\r\n发现一个问题，再我没有指定lb的情况下，channel会通过gethostbyname()这个系统调用获取该url映射的ip列表，但是它只取第一个ip，以后每次访问都是这个ip，而且后端扩容下线都感知不到，我理解后端如果映射的是一个虚拟ip，应该无关，若不是。。。不理解为何这么设计？ @jamesge "},"comment":{"url":"https://api.github.com/repos/brpc/brpc/issues/comments/414978127","html_url":"https://github.com/brpc/brpc/issues/461#issuecomment-414978127","issue_url":"https://api.github.com/repos/brpc/brpc/issues/461","id":414978127,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDk3ODEyNw==","user":{"login":"jamesge","id":6566535,"node_id":"MDQ6VXNlcjY1NjY1MzU=","avatar_url":"https://avatars0.githubusercontent.com/u/6566535?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesge","html_url":"https://github.com/jamesge","followers_url":"https://api.github.com/users/jamesge/followers","following_url":"https://api.github.com/users/jamesge/following{/other_user}","gists_url":"https://api.github.com/users/jamesge/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesge/subscriptions","organizations_url":"https://api.github.com/users/jamesge/orgs","repos_url":"https://api.github.com/users/jamesge/repos","events_url":"https://api.github.com/users/jamesge/events{/privacy}","received_events_url":"https://api.github.com/users/jamesge/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T09:52:50Z","updated_at":"2018-08-22T09:52:50Z","author_association":"MEMBER","body":"这种模式下的channel就是这样的，会在Init时做一次dns查找，之后就再也不更新了。如果要更新的话，就要指明lb。"}}
{"actor":{"display_login":"jamesge"}}