src/net/dns/dns_session.cc
// Allocate a socket, already connected to the server address.
Allocate a socket, already connected to the server address.
Allocate a socket already connected to the server address .
std::unique_ptr<DnsSession::SocketLease> DnsSession::AllocateSocket(
    size_t server_index,
    const NetLogSource& source) {
  std::unique_ptr<DatagramClientSocket> socket;
  socket = socket_pool_->AllocateSocket(server_index);
  if (!socket.get())
    return std::unique_ptr<SocketLease>();
  socket->NetLog().BeginEventReferencingSource(NetLogEventType::SOCKET_IN_USE,
                                               source);
  SocketLease* lease = new SocketLease(this, server_index, std::move(socket));
  return std::unique_ptr<SocketLease>(lease);
}
std :: unique_ptr < DnsSession :: SocketLease > DnsSession :: AllocateSocket ( size_t server_index , const NetLogSource & source ) { std :: unique_ptr < DatagramClientSocket > socket ; socket = socket_pool_ -> AllocateSocket ( server_index ) ; if ( ! socket . get ( ) ) return std :: unique_ptr < SocketLease > ( ) ; socket -> NetLog ( ) . BeginEventReferencingSource ( NetLogEventType :: SOCKET_IN_USE , source ) ; SocketLease * lease = new SocketLease ( this , server_index , std :: move ( socket ) ) ; return std :: unique_ptr < SocketLease > ( lease ) ; }
Allocate a socket, already connected to the server address.
Allocate a socket already connected to the server address .