Source/NFX.Erlang/Connect/Transport/ErlTransportPasswordSource.cs
/// <summary>
/// Returns password for specified userName and nodeName
/// </summary>
Returns password for specified userName and nodeName
Returns password for specified userName and nodeName
public static SecureString GetPassword(object sender, string nodeName, string userName)
    {
      ErlPasswordSession res = null;
      var inCache = false;
      lock (s_PassCache)
          inCache = s_PassCache.TryGetValue(new ErlPasswordSession(nodeName, userName), out res);
      if (inCache)
      {
        if (res.Password == null && PasswordRequired != null) 
          PasswordRequired(res);
        if (res.Password != null)
          return res.Password;
      }
      throw new ErlException("Password session not started for {0} user {1}".Args(nodeName, userName));
    }
public static SecureString GetPassword ( object sender , string nodeName , string userName ) { ErlPasswordSession res = null ; var inCache = false ; lock ( s_PassCache ) inCache = s_PassCache . TryGetValue ( new ErlPasswordSession ( nodeName , userName ) , out res ) ; if ( inCache ) { if ( res . Password == null && PasswordRequired != null ) PasswordRequired ( res ) ; if ( res . Password != null ) return res . Password ; } throw new ErlException ( " " . Args ( nodeName , userName ) ) ; }
Returns password for specified userName and nodeName
Returns password for specified userName and nodeName
//check cache //ask user about password
sender
object
nodeName
string
userName
string