Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 139b372f authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Start retiring socket_loopback_client.

Bug: http://b/31537253
Test: can still talk to adb
Change-Id: Icfd7f00d35cf963befc139e81904790b4b8b67c0
parent 0d762648
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+1 −18
Original line number Diff line number Diff line
@@ -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);
}