public MultiServerSync(IConnectionManager connectionManager, ILogger logger, ILocalAssetManager userActionAssetManager, IFileTransferManager fileTransferManager) { _connectionManager = connectionManager; _logger = logger; _localAssetManager = userActionAssetManager; _fileTransferManager = fileTransferManager; }
public FileOperationProcessor( IFileTransferManager fileTransferManager, OperationFactory operationFactory) { _fileTransferManager = fileTransferManager; _operationFactory = operationFactory; }
public MultiServerSync(IConnectionManager connectionManager, ILogger logger, ILocalAssetManager userActionAssetManager, IFileTransferManager fileTransferManager) { _connectionManager = connectionManager; _logger = logger; _localAssetManager = userActionAssetManager; _fileTransferManager = fileTransferManager; }
public TransportManager(IFileTransferManager fileTransferManager, ILoggingService loggingService) { this.fileTransferManager = fileTransferManager; this.loggingService = loggingService; friendlyNames.Add(typeof(TcpTransport), "TCP"); }
public ServerSync(IConnectionManager connectionManager, ILogger logger, ILocalAssetManager localAssetManager, IFileTransferManager fileTransferManager, ClientCapabilities clientCapabilities) { _connectionManager = connectionManager; _fileTransferManager = fileTransferManager; _clientCapabilities = clientCapabilities; _logger = logger; _localAssetManager = localAssetManager; }
public ServerSync(IConnectionManager connectionManager, ILogger logger, ILocalAssetManager localAssetManager, IFileTransferManager fileTransferManager, ClientCapabilities clientCapabilities) { _connectionManager = connectionManager; _fileTransferManager = fileTransferManager; _clientCapabilities = clientCapabilities; _logger = logger; _localAssetManager = localAssetManager; }
public FileBatchManager( IFileTransferManager fileTransferManager, Func<IFileTransferManager, IFileOperationProcessor> fileOperationProcessorFactory, ILogger logger) { _fileTransferManager = fileTransferManager; _fileOperationProcessorFactory = fileOperationProcessorFactory; _logger = logger; }
public FileMessageListenerService( EventingSerializationBasicConsumer<FileMessage> consumer, IFileTransferManager fileTransferManager, FileMessageDispatcherFactory fileMessageDispatcherFactory) { _consumer = consumer; _fileTransferManager = fileTransferManager; _fileMessageDispatcherFactory = fileMessageDispatcherFactory; _fileMessageDispatcher = _fileMessageDispatcherFactory.Create(); }
public MediaSync(ILocalAssetManager localAssetManager, ILogger logger, IFileTransferManager fileTransferManager) { _localAssetManager = localAssetManager; _logger = logger; _fileTransferManager = fileTransferManager; }
public FileSender(IFileTransferManager transferManager, string harvester) { _transferManager = transferManager; _harvester = harvester; }
public FileSystemProvider(ILoggingService loggingService, IFileTransferManager fileTransferManager) { this.loggingService = loggingService; this.fileTransferManager = fileTransferManager; string path = Path.Combine(Core.Settings.DataPath, "shares.db"); bool create = false; if (!System.IO.File.Exists(path)) { create = true; } connectionString = String.Format("URI=file:{0},version=3;busy_timeout=300000", path); if (!create) { try { // Do some sanity checking here, if anything looks bad, start over if (RootDirectory == null) { this.loggingService.LogWarning("Unable to find root dir"); create = true; } else { // Verify version string currentVersion = ExecuteScalar("SELECT value FROM properties WHERE name='version'").ToString(); if (currentVersion != SCHEMA_VERSION) { this.loggingService.LogWarning("Schema has changed, recreating db."); create = true; } } } catch (Exception) { //XXX: Only catch SQLite errors like this! // Something is probably wrong with the // schema, lets start over. create = true; } } if (create) { CreateTables(); // Kill any active connections, they wont be able to reach the new db. lock (connections) { while (connections.Count > 0) { connections[0].Dispose(); connections.RemoveAt(0); } } // Force a scan. Core.Settings.LastShareScan = DateTime.MinValue; } }
public MediaSync(ILocalAssetManager localAssetManager, ILogger logger, IFileTransferManager fileTransferManager) { _localAssetManager = localAssetManager; _logger = logger; _fileTransferManager = fileTransferManager; }
public static bool Init(ISettings settings) { if (loaded == true) { throw new Exception("Please only call this method once."); } if (settings == null) { throw new ArgumentNullException("settings"); } Core.Settings = settings; string pidFilePath = Path.Combine(Core.Settings.DataPath, "meshwork.pid"); if (File.Exists(pidFilePath)) { int processId = -1; Int32.TryParse(File.ReadAllText(pidFilePath), out processId); try { Process.GetProcessById(processId); Console.Error.WriteLine("Meshwork is already running (PID {0})!", processId); return(false); } catch (ArgumentException) { File.Delete(pidFilePath); } } File.WriteAllText(pidFilePath, Process.GetCurrentProcess().Id.ToString()); if (settings.KeyEncrypted) { PasswordPrompt(null, EventArgs.Empty); if (!settings.KeyUnlocked) { // Quit! return(false); } } rsaProvider = new RSACryptoServiceProvider(); rsaProvider.ImportParameters(settings.EncryptionParameters); nodeID = Common.SHA512Str(rsaProvider.ToXmlString(false)); fileSystem = Container.GetExportedValue <IFileSystemProvider>(); shareBuilder = Container.GetExportedValue <IShareBuilder>(); shareBuilder.FinishedIndexing += ShareBuilder_FinishedIndexing; shareWatcher = Container.GetExportedValue <IShareWatcher>(); shareHasher = Container.GetExportedValue <IShareHasher>(); transportManager = Container.GetExportedValue <ITransportManager>(); fileTransferManager = Container.GetExportedValue <IFileTransferManager>(); fileSearchManager = Container.GetExportedValue <IFileSearchManager>(); destinationManager = Container.GetExportedValue <IDestinationManager>(); // XXX: Use reflection to load these: destinationManager.RegisterSource(new TCPIPv4DestinationSource()); destinationManager.RegisterSource(new TCPIPv6DestinationSource()); MonoTorrent.Client.Tracker.TrackerFactory.Register("meshwork", typeof(MeshworkTracker)); ITransportListener tcpListener = new TcpTransportListener(Core.Settings.TcpListenPort); transportListeners.Add(tcpListener); loaded = true; if (FinishedLoading != null) { FinishedLoading(null, EventArgs.Empty); } return(true); }