public async static Task <ReconnectingSamHelper> CreateInstance( ReconnectingSamHelperSettings settings, CancellationToken token ) { if (settings == null) { throw new ArgumentNullException( MyNameof.GetLocalVarName(() => settings)); } settings.CheckMe(); var result = new ReconnectingSamHelper(); result._settings = settings; await result.InitImpl(token).ConfigureAwait(false); result._session = result._currentImplementationHelper.Session; if ( string.IsNullOrWhiteSpace( settings.ImplementationHelperSettings.SessionPrivateKeys ) ) { settings.ImplementationHelperSettings.SessionPrivateKeys = result._session.PrivateKey; } result._stateHelper.SetInitializedState(); return(result); }
public ReconnectingSamHelperSettings( ReconnectingSamHelperSettings copyFrom) { TimeoutOnIoException = copyFrom.TimeoutOnIoException; DelayOnConnectFailed = copyFrom.DelayOnConnectFailed; if(copyFrom.ImplementationHelperSettings != null) ImplementationHelperSettings = new SamHelperSettings( copyFrom.ImplementationHelperSettings); }
public ReconnectingSamHelperSettings( ReconnectingSamHelperSettings copyFrom) { TimeoutOnIoException = copyFrom.TimeoutOnIoException; DelayOnConnectFailed = copyFrom.DelayOnConnectFailed; if (copyFrom.ImplementationHelperSettings != null) { ImplementationHelperSettings = new SamHelperSettings( copyFrom.ImplementationHelperSettings); } }
public async static Task<ReconnectingSamHelper> CreateInstance( ReconnectingSamHelperSettings settings, CancellationToken token ) { if(settings == null) throw new ArgumentNullException( MyNameof.GetLocalVarName(() => settings)); settings.CheckMe(); var result = new ReconnectingSamHelper(); result._settings = settings; await result.InitImpl(token).ConfigureAwait(false); result._session = result._currentImplementationHelper.Session; if ( string.IsNullOrWhiteSpace( settings.ImplementationHelperSettings.SessionPrivateKeys ) ) settings.ImplementationHelperSettings.SessionPrivateKeys = result._session.PrivateKey; result._stateHelper.SetInitializedState(); return result; }