GetSocket() private method

private GetSocket ( ) : Socket
return Socket
        private ClientConnection GetNewConnection(Address address, Authenticator authenticator)
        {
            ClientConnection connection = null;

            lock (_connectionMutex)
            {
                var id = _nextConnectionId;
                try
                {
                    Logger.Finest("Creating new connection for " + address + " with id " + id);
                    connection = new ClientConnection(this, (ClientInvocationService)_client.GetInvocationService(),
                                                      id,
                                                      address, _networkConfig);
                    if (_socketInterceptor != null)
                    {
                        _socketInterceptor.OnConnect(connection.GetSocket());
                    }
                    connection.SwitchToNonBlockingMode();
                    authenticator(connection);
                    Interlocked.Increment(ref _nextConnectionId);
                    Logger.Finest("Authenticated to " + connection);
                    return(connection);
                }
                catch (Exception e)
                {
                    Logger.Severe("Error connecting to " + address + " with id " + id, e);
                    if (connection != null)
                    {
                        connection.Close();
                    }
                    throw ExceptionUtil.Rethrow(e, typeof(IOException), typeof(SocketException));
                }
            }
        }
 private ClientConnection InitializeConnection(Address address, Authenticator authenticator)
 {
     CheckLive();
     ClientConnection connection = null;
     var id = _nextConnectionId;
     try
     {
         Logger.Finest("Creating new connection for " + address + " with id " + id);
         connection = new ClientConnection(this, (ClientInvocationService) _client.GetInvocationService(),
             id,
             address, _networkConfig);
         if (_socketInterceptor != null)
         {
             _socketInterceptor.OnConnect(connection.GetSocket());
         }
         connection.SwitchToNonBlockingMode();
         authenticator(connection);
         Interlocked.Increment(ref _nextConnectionId);
         Logger.Finest("Authenticated to " + connection);
         return connection;
     }
     catch (Exception e)
     {
         Logger.Severe("Error connecting to " + address + " with id " + id, e);
         if (connection != null)
         {
             connection.Close();
         }
         throw ExceptionUtil.Rethrow(e, typeof (IOException), typeof (SocketException),
             typeof (TargetDisconnectedException));
     }
 }