Hi. I have distributed my application to several users, all but one of whom are able to upload to my FTP site without error. However, for one user the following exception is being thrown. I believe this is being caught by my thread exception handler, so I am unable to determine the entry point which is the source of this stack, but my guess is FtpClient.Connect(string,int):
SocketException : The attempted operation is not supported for the type of object referenced
at System.Net.Sockets.Socket.get_ConnectEx()
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at Xceed.Utils.Security.Ssl.SecureSocket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at Xceed.Ftp.Engine.FtpCommandChannel.BeginConnect(IPEndPoint localAddress, IPEndPoint remoteAddress, AsyncCallback callback, Object state)
I am not actually connecting over SSL so I'm not sure why I am seeing an SSL namespace in the stack (the connection in on port 21) but google points to a number of issues related to corrupt WinSock implementation and possibly the use of threadpool threads for asynchronous socket operations, but I wondered if anyone can give me any pointers. I cannot reproduce the error on my machine so any investigation will have to be done remotely.
My FTP assembly is version 3.3.7113.3050
I am not able to post full source code for my app, but here is a summary of the Xceed FTP calls being made:
FtpClient client = new FtpClient();
client.Timeout = myTimeout;
client.Connect(myAddress, myPort);
client.Login(myUsername, myPassword);
client.ChangeCurrentFolder(myFolder);
client.GetFolderContents(myFilename1);
client.FileTransferStatus += new FileTransferStatusEventHandler(FtpClient_FileTransferStatus);
client.SendFile(myStream, myFilename1, false);
client.RenameFile(myFilename1, myFilename2);
if (client != null)
{
client.FileTransferStatus -= new FileTransferStatusEventHandler(FtpClient_FileTransferStatus);
if (client.Connected)
client.Disconnect();
}
Thanks
kh