-
June 16th, 2009, 11:01 AM
#1
Multiply FTP Sessions in Background Workers
I use a Background Workers for open multiply FTP Connections to same FTP Server. I use Active FTP Mode and use a asynchronous requests. When I start 2 connections together, the first one is working properly and the second isn't receive Data ( connection established ). When I run two applications with one FTP Session for each, I haven't any problems. I'm connect to 21 port. Haw can I change a Data port selection in Active FTP mode for different sessions, or may be this is another problem.
This is a part of request code (21- the port ):
Code:
// sPath = "ftp://user_name:user_pass@server_address:21//path")
FtpWebRequest request = (FtpWebRequest)WebRequest.Create( sPath );
request.UsePassive = false;
request.Proxy = null;
request.Method = WebRequestMethods.Ftp.GetFileSize;
this.curFTPState.FileName = Path.Combine(sPathTo, filename);
this.curFTPState.FTPMethod = WebRequestMethods.Ftp.GetFileSize;
this.curFTPState.Request = request;
// Start the asynchronous request.
IAsyncResult result = (IAsyncResult)request.BeginGetResponse(new AsyncCallback(RespCallback), curFTPState);
Thanks
Elina
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|