acelyc111 commented on code in PR #1897:
URL: 
https://github.com/apache/incubator-pegasus/pull/1897#discussion_r1497094460


##########
src/runtime/rpc/rpc_address.h:
##########
@@ -66,71 +66,48 @@ class rpc_address
 {
 public:
     static const rpc_address s_invalid_address;
+
+    // Convert IPv4:port to rpc_address, e.g. "192.168.0.1:12345" or 
"localhost:54321".
+    // NOTE:
+    //   - IP address without port (e.g. "127.0.0.1") is considered as invalid.
+    static rpc_address from_ip_port(std::string_view ip_port);
+
+    // Similar to the above, but specify the 'ip' and 'port' separately.
+    static rpc_address from_ip_port(std::string_view ip, uint16_t port);
+
+    // Convert hostname:port to rpc_address, e.g. "192.168.0.1:12345", 
"localhost:54321" or
+    // "host1:12345".
+    // NOTE:
+    //   - Hostname without port (e.g. "host1") is considered as invalid.
+    //   - It contains a hostname resolve produce, so typically it's slower 
than from_ip_port().
+    //   - It requires 'hostname' is a null terminate string which only 
contains hostname.
+    static rpc_address from_host_port(std::string_view host_port);
+
+    // Similar to the above, but specify the 'host' and 'port' separately.
+    static rpc_address from_host_port(std::string_view host, uint16_t port);
+
     static bool is_docker_netcard(const char *netcard_interface, uint32_t 
ip_net);
     static bool is_site_local_address(uint32_t ip_net);
-    static uint32_t ipv4_from_host(const char *hostname);
+    // TODO(yingchun): Use dsn_resolver to resolve hostname.
+    static error_s ipv4_from_host(const char *hostname, uint32_t *ip);

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to