wenjiecn commented on code in PR #3179:
URL: https://github.com/apache/brpc/pull/3179#discussion_r2659592533
##########
src/brpc/socket.cpp:
##########
@@ -1296,7 +1296,17 @@ int Socket::Connect(const timespec* abstime,
CHECK_EQ(0, butil::make_close_on_exec(sockfd));
// We need to do async connect (to manage the timeout by ourselves).
CHECK_EQ(0, butil::make_non_blocking(sockfd));
-
+ if (local_side().ip != butil::IP_ANY) {
+ struct sockaddr_storage cli_addr;
+ if (butil::endpoint2sockaddr(local_side(), &cli_addr, &addr_size) !=
0) {
+ PLOG(ERROR) << "Fail to get client sockaddr";
+ return -1;
+ }
+ if (::bind(sockfd, (struct sockaddr*)&cli_addr, addr_size) != 0) {
Review Comment:
好的,我现在看一下
--
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]