public override void OnCommand(ITFtpCommand command, EndPoint endpoint)
        {
            if (!endpoint.Equals(Context.GetConnection().RemoteEndpoint))
            {
                throw new Exception($"Received message from illegal endpoint. Actual: {endpoint}. Expected: {Context.GetConnection().RemoteEndpoint}");
            }

            command.Visit(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Call this method to serialize the given <code>command</code> using the given <code>writer</code>.
        /// </summary>
        public void Serialize(ITFtpCommand command, Stream stream)
        {
            CommandComposerVisitor visitor = new CommandComposerVisitor(stream);

            command.Visit(visitor);
        }