Exemplo n.º 1
0
        internal Task <FtpResponse> GetResponseAsync()
        {
            return(Task.Run(() =>
            {
                // Wait for one DataReader.LoadAsync() to complete.
                loadCompleteEvent.WaitOne();

                FtpResponse response = new FtpResponse(readCommands.ToArray());
                readCommands = new List <string>();
                return response;
            }));
        }
Exemplo n.º 2
0
        internal static void VerifyResponse(FtpResponse response, uint[] expectedReplyCodes)
        {
            foreach (uint expectedReplyCode in expectedReplyCodes)
            {
                if (expectedReplyCode == response.ReplyCode)
                {
                    return;
                }
            }

            throw new Exception(String.Format(
                                    "FTP: Expected reply code was {0}, however the server replied: {1}",
                                    JoinRetryCodes(expectedReplyCodes),
                                    response.ToString().Trim()));
        }
Exemplo n.º 3
0
 internal static void VerifyResponse(FtpResponse response, uint expectedReplyCode)
 {
     VerifyResponse(response, new uint[] { expectedReplyCode });
 }
Exemplo n.º 4
0
        internal static void VerifyResponse(FtpResponse response, uint[] expectedReplyCodes)
        {
            foreach (uint expectedReplyCode in expectedReplyCodes)
            {
                if (expectedReplyCode == response.ReplyCode)
                {
                    return;
                }
            }

            throw new Exception(String.Format(
                "FTP: Expected reply code was {0}, however the server replied: {1}",
                JoinRetryCodes(expectedReplyCodes),
                response.ToString().Trim()));
        }
Exemplo n.º 5
0
 internal static void VerifyResponse(FtpResponse response, uint expectedReplyCode)
 {
     VerifyResponse(response, new uint[] { expectedReplyCode });
 }
Exemplo n.º 6
0
        internal Task<FtpResponse> GetResponseAsync()
        {
            return Task.Run(() =>
            {
                // Wait for one DataReader.LoadAsync() to complete.
                loadCompleteEvent.WaitOne();

                FtpResponse response = new FtpResponse(readCommands.ToArray());
                readCommands = new List<string>();
                return response;
            });
        }