private void ConnectInternal(ConnectState state) { _worker.QueueOneTime(() => { if (!state.Connection.IsConnected) { state.Connection.Close(); } }, 2.Seconds()); state.Connection.Connect(success => { if (success) { state.SuccessCallback(); } else { state.FailureCallback(); } }); }