B
Brian Taylor
We have a FTP copy program that queries a number of sites for data. However
it suddenly stopped working on Windows Server 2003 (but it still works fine
on Windows XP). What is more confusing is that it stopped for only 2 ftp
servers out of around 15 (Unix servers)! Note that other ftp clients can
still connect to these Unix servers.
The code (below) failes on the connection. Note that "iRet" gives a value of
"0", which according to the documentation, I think means that the connection
was shutdown by the server. If this is the case why would this just start
happening? How can we debug this problem?
Brian
FTPSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
IPEndPoint ipend = new IPEndPoint(Dns.Resolve(Host).AddressList[0],Port);
FTPSocket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveTimeout, 60000);
FTPSocket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.SendTimeout, 60000);
FTPSocket.Connect((EndPoint)ipend);
FTPStream = new NetworkStream(FTPSocket,FileAccess.ReadWrite,true);
FTPWriter = new StreamWriter(FTPStream);
iRet = FTPSocket.Receive(abyBuffer,0,4096,SocketFlags.None);
it suddenly stopped working on Windows Server 2003 (but it still works fine
on Windows XP). What is more confusing is that it stopped for only 2 ftp
servers out of around 15 (Unix servers)! Note that other ftp clients can
still connect to these Unix servers.
The code (below) failes on the connection. Note that "iRet" gives a value of
"0", which according to the documentation, I think means that the connection
was shutdown by the server. If this is the case why would this just start
happening? How can we debug this problem?
Brian
FTPSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
IPEndPoint ipend = new IPEndPoint(Dns.Resolve(Host).AddressList[0],Port);
FTPSocket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveTimeout, 60000);
FTPSocket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.SendTimeout, 60000);
FTPSocket.Connect((EndPoint)ipend);
FTPStream = new NetworkStream(FTPSocket,FileAccess.ReadWrite,true);
FTPWriter = new StreamWriter(FTPStream);
iRet = FTPSocket.Receive(abyBuffer,0,4096,SocketFlags.None);