OnCommandSent() private method

private OnCommandSent ( string command ) : void
command string
return void
示例#1
0
        /// <summary>
        /// Send FTP command to control channel.
        /// </summary>
        /// <param name="cmd">A <see cref="String"/> representing the command to send.</param>
        public void Command(string cmd)
        {
            if ((object)m_connection == null)
            {
                return;
            }

            byte[]        buff   = Encoding.Default.GetBytes(cmd + Environment.NewLine);
            NetworkStream stream = m_connection.GetStream();

            m_sessionHost.OnCommandSent(cmd);
            stream.Write(buff, 0, buff.Length);
            RefreshResponse();
        }
示例#2
0
        /// <summary>
        /// Send FTP command to control channel.
        /// </summary>
        /// <param name="cmd">A <see cref="String"/> representing the command to send.</param>
        public void Command(string cmd)
        {
            if ((object)m_connection == null)
            {
                return;
            }

            // If the client receives an exception when establishing a data channel,
            // it may not have checked for the server's response when handling the exception
            FlushResponses();

            byte[]        buff   = Encoding.Default.GetBytes(cmd + Environment.NewLine);
            NetworkStream stream = m_connection.GetStream();

            m_sessionHost.OnCommandSent(cmd);
            stream.Write(buff, 0, buff.Length);
            RefreshResponse();
        }