From a7b245d36350cba9de115ba0302e631dc031b586 Mon Sep 17 00:00:00 2001 From: tfarina Date: Mon, 1 Feb 2016 18:03:49 -0800 Subject: net: add BindAndListen() method to UnixDomainServerSocket This method was designed to support the Unix Domain Socket case, where the address + port pair does not make sense, as it uses files for sockets instead. This makes the callsites cleaner. With this addition there is no need to override ListenWithAddressAndPort from ServerSocket. BUG=None TEST=net_unittests R=mmenke@chromium.org,mkwst@chromium.org TBR=gunsch@chromium.org,boliu@chromium.org,sergeyu@chromium.org,newt@chromium.org Review URL: https://codereview.chromium.org/1644003002 Cr-Commit-Position: refs/heads/master@{#372859} --- remoting/host/gnubby_auth_handler_posix.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remoting') diff --git a/remoting/host/gnubby_auth_handler_posix.cc b/remoting/host/gnubby_auth_handler_posix.cc index 5592b3a..4960e0d 100644 --- a/remoting/host/gnubby_auth_handler_posix.cc +++ b/remoting/host/gnubby_auth_handler_posix.cc @@ -257,8 +257,8 @@ void GnubbyAuthHandlerPosix::CreateAuthorizationSocket() { auth_socket_.reset( new net::UnixDomainServerSocket(base::Bind(MatchUid), false)); - int rv = auth_socket_->ListenWithAddressAndPort( - g_gnubby_socket_name.Get().value(), 0, 1); + int rv = auth_socket_->BindAndListen(g_gnubby_socket_name.Get().value(), + /*backlog=*/1); if (rv != net::OK) { LOG(ERROR) << "Failed to open socket for gnubby requests"; return; -- cgit v1.1