Exemple #1
0
        /// <summary>
        /// Sends a binary data to the client associated with the specified ID.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the client associated with <paramref name="id"/> is successfully found;
        /// otherwise, <c>false</c>.
        /// </returns>
        /// <param name="id">
        /// A <see cref="string"/> that contains an ID that represents the destination for the data.
        /// </param>
        /// <param name="data">
        /// An array of <see cref="byte"/> that contains a binary data to send.
        /// </param>
        public bool SendTo(string id, byte [] data)
        {
            var msg = id.IsNullOrEmpty()
                ? "'id' must not be null or empty."
                : data == null
                  ? "'data' must not be null."
                  : String.Empty;

            if (msg.Length > 0)
            {
                Log.Error(msg);
                Error(msg);

                return(false);
            }

            return(_sessions.SendTo(id, data));
        }