问题描述
我正在尝试连接到FTP服务器,因此仅一次建立了连接,而我想打开多个连接并使用线程上传多个文件.一切正常,仅当我上传单个文件时. (1比1).
连接到FTP Server时打开多个连接时出现错误.
I am trying to Connect to FTP Server, well the connection is established only once, while I want to open multiple connections and upload multiple files using threading. everything works fine Only if I upload single file. (1 by 1).
The error appears while connecting to FTP Server opening multiple connections.
protected bool login()
{
bool connected = false;
try
{
IPEndPoint ip = new IPEndPoint(Dns.Resolve(ftpAddress).AddressList[0],ftpPort); //PORT = 21
socket.Connect(ip); //The error occurs in this statement
}
catch (Exception ex)
{
Debug.Write(ex.Message);
}
return connected;
}
并且出现错误"提供了无效的参数FTP服务器IP "
我用谷歌搜索,但是没有解决方案.
我很高兴了解如果打开与ftp服务器的多个连接为什么会出现错误?
and I am getting the error "An invalid argument was supplied FTP SERVER IP"
I googled but no solution helped.
I do appreciate to understand why the error appears if I open multiple connection to ftp server?
推荐答案
您尝试过吗?
Have you tried that?
这篇关于提供了无效的参数(套接字)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!