using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EMDServer.Common
{
    public class CommandHandler:EventArgs
    {
        public Command cmd;
    }

    public interface iEMDConnection
    {
        /// <summary>
        /// EventHandler which is called upon receiving a new command
        /// </summary>
        event EventHandler<CommandHandler> cmdReceived;

        /// <summary>
        /// Server opens this connection to this Interface
        /// </summary>
        /// <returns>return true if successful</returns>
        bool openConnection();
        /// <summary>
        /// Server closes this interface by calling this method
        /// </summary>
        /// <returns>return true if successful</returns>
        bool closeConnection();
        /// <summary>
        /// Server sends commands through this method
        /// </summary>
        /// <param name="cmd">Command which has been sent to you</param>
        void sendCommand(Command cmd);
        /// <summary>
        /// Client has to call this method to inform server about new message.
        /// </summary>
        /// <param name="cmd">Command which you want to send to server</param>
        void onCommandReceived(Command cmd);
    }
}
