Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/02/2015, 11:01
Pimager
 
Fecha de Ingreso: julio-2010
Mensajes: 298
Antigüedad: 13 años, 9 meses
Puntos: 8
Error al cerrar una conexión sFTP usando Tamir

Hola,
Tengo un problemilla con un sFTP usando Tamir.
El escenario es el siguiente, abro la conexión y envío el fichero:
Código:
Tamir.SharpSsh.Sftp sftp = new Tamir.SharpSsh.Sftp(ftpServer, FTPUser, FTPPassword);
sftp.OnTransferStart += new Tamir.SharpSsh.FileTransferEvent(sftp_OnTransferStart);
sftp.OnTransferEnd += new Tamir.SharpSsh.FileTransferEvent(sftp_OnTransferEnd);
sftp.Connect(FTPPort);
sftp.Put(zipFile, FTPPath);
private void sftp_OnTransferStart(string src, string dst, int transferredBytes, int totalBytes, string message)
        {
            //do nothing
        }

        private void sftp_OnTransferEnd(string src, string dst, int transferredBytes, int totalBytes, string message)
        {
            //do nothing
        }
Pero cuando tengo que realizar la función
Código:
sftp.Close();
Me da el siguiente error:
System.NullReferenceException Object reference not set an instance of an object.
at Tamir.SharpSsh.Close()


Alguien sabe a que se refiere? Porqué sucede esto? El fichero no llega a enviarse al destino.

Muchas gracias de antemano