Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Commented Unassigned: An operation was attempted on something that is not a socket. [1940]

$
0
0
I keep getting this error when connecting and uploading a file. There are no errors in Event Log or otherwise.

Here's my code:

SSHNet.PasswordConnectionInfo connInfo = new SHNet.PasswordConnectionInfo(xxxxxxxxxxx);

using (var client = new SSHNet.SftpClient(connInfo))
{
client.Connect();
if (client.IsConnected)
{
using (Stream fileStream = EncryptionUtilities.DecryptFile(path))
{
client.UploadFile(fileStream, path);
fileStream.Flush();
fileStream.Close();
fileStream.Dispose();
}
}

client.Disconnect();
}

Any suggestions highly appreciated.
Comments: ** Comment from web user: avidyarthi **


Here is the stack trace:

System.Net.Sockets.SocketException (0x80004005): An operation was attempted on something that is not a socket
at System.Net.Sockets.Socket.Poll(Int32 microSeconds, SelectMode mode)
at Renci.SshNet.Extensions.CanWrite(Socket socket)
at Renci.SshNet.Session.SendMessage(Message message)
at Renci.SshNet.Session.SendDisconnect(DisconnectReason reasonCode, String message)
at Renci.SshNet.Session.Disconnect()
at Renci.SshNet.BaseClient.Disconnect()


Viewing all articles
Browse latest Browse all 1026

Trending Articles