/// <summary>
        /// Envia el mensaje en respuesta a otro
        /// </summary>
        /// <param name="msg">Mensahe</param>
        /// <param name="inResponseTo">En respuesta a</param>
        /// <returns></returns>
        public int SendReply(IXPloitSocketMsg msg, IXPloitSocketMsg inResponseTo)
        {
            if (inResponseTo != null)
            {
                XPloitMsgHeaderId headerId = inResponseTo.Headers.GetHeader <XPloitMsgHeaderId>();
                if (headerId != null)
                {
                    msg.Headers.Add(XPloitMsgHeaderReply.CreateNew(headerId.Id));
                }
            }

            return(Send(msg));
        }
        /// <summary>
        /// Envia el mensaje y devuelve una respuesta, Este método nunca hay que llamarlo desde el hilo del Socket
        /// </summary>
        /// <param name="msg">Mensaje</param>
        public IXPloitSocketMsg SendAndWait(IXPloitSocketMsg msg)
        {
            XPloitMsgHeaderId headerId = XPloitMsgHeaderId.CreateNew();

            msg.Headers.Add(headerId);

            Guid wait = headerId.Id;

            if (Send(msg) <= 0)
            {
                return(null);
            }

            IXPloitSocketMsg msgRet;

            while (!_Actions.TryGetValue(wait, out msgRet))
            {
                //Read();
                Thread.Sleep(0);
            }
            return(msgRet);
        }