Merge "Start retiring socket_loopback_client." am: 58f7f61266 am: cd0e8cfd33

am: aa509a3e9d

Change-Id: Iea3a25f193b9249ba93d49514b2a409d693121e1
This commit is contained in:
Elliott Hughes 2016-10-13 15:00:24 +00:00 committed by android-build-merger
commit fc485e4488
2 changed files with 2 additions and 19 deletions

View file

@ -594,7 +594,7 @@ inline int _fd_set_error_str(int fd, std::string* error) {
}
inline int network_loopback_client(int port, int type, std::string* error) {
return _fd_set_error_str(socket_loopback_client(port, type), error);
return _fd_set_error_str(socket_network_client("localhost", port, type), error);
}
inline int network_loopback_server(int port, int type, std::string* error) {

View file

@ -35,23 +35,6 @@
*/
int socket_loopback_client(int port, int type)
{
struct sockaddr_in addr;
int s;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
s = socket(AF_INET, type, 0);
if(s < 0) return -1;
if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
close(s);
return -1;
}
return s;
return socket_network_client("localhost", port, type);
}