예제 #1
0
 /// <summary>
 /// Sets all variables to the closed state.
 /// </summary>
 private void ClosePrivate(ConnectionCloseReason reason, string message, Exception exception)
 {
     ConnectionAvailable = false;
     connectionLost      = true;
     Channel.Shutdown();
     FileTransfer?.Dispose(); // Cancel running file transfer
     OnConnectionClosed(reason, message, exception);
 }
예제 #2
0
 /// <summary>
 /// Create FileTransfer
 /// </summary>
 public static void Create(bool dispose = false)
 {
     if (dispose && _transfer != null)
     {
         _transfer.Dispose();
         return;
     }
     _transfer = new FileTransfer();
     _transfer.Listen(InfrastructureRepository.RootPath, (ushort)_config.ListenedAddress.Port);
     _transfer.Prepare   += new EventHandler <TransferEventArgs>(_transfer_Prepare);
     _transfer.Completed += new EventHandler <TransferEventArgs>(_transfer_Completed);
 }