SftpClient UploadFile throws SocketException: 'An existing connection was forcibly closed by the remote host'
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 4.4k
- Fork
- 993
- Merge medio
- 9g 21h
- PR unite (30g)
- 1
Descrizione
This exception has been thrown when VPN client is connected. Same code works fine if VPN is switch off.

StackTrace:
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Renci.SshNet.Abstractions.SocketAbstraction.Send(Socket socket, Byte[] data, Int32 offset, Int32 size)
at Renci.SshNet.Session.SendPacket(Byte[] packet, Int32 offset, Int32 length)
at Renci.SshNet.Session.SendMessage(Message message)
at Renci.SshNet.Session.Renci.SshNet.ISession.SendMessage(Message message)
at Renci.SshNet.Channels.Channel.SendData(Byte[] data, Int32 offset, Int32 size)
at Renci.SshNet.Channels.Channel.SendData(Byte[] data)
at Renci.SshNet.SubsystemSession.SendData(Byte[] data)
at Renci.SshNet.Sftp.SftpSession.SendRequest(SftpRequest request)
at Renci.SshNet.Sftp.SftpSession.RequestWrite(Byte[] handle, UInt64 serverOffset, Byte[] data, Int32 offset, Int32 length, AutoResetEvent wait, Action1 writeCompleted)
at Renci.SshNet.SftpClient.InternalUploadFile(Stream input, String path, Flags flags, SftpUploadAsyncResult asyncResult, Action1 uploadCallback)
at Renci.SshNet.SftpClient.UploadFile(Stream input, String path, Boolean canOverride, Action`1 uploadCallback)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo SftpClient.UploadFile con la condizione VPN segnalata, quindi traccia l’errore attraverso SftpClient.InternalUploadFile, SftpSession.RequestWrite, Session.SendPacket e SocketAbstraction.Send. Confronta il comportamento con e senza VPN e determina se il problema può essere isolato come una condizione riproducibile della libreria o dell’ambiente; il lavoro è completato quando la causa e una correzione o limitazione attuabile sono documentate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- networking
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 28/100