SendMessage() public method

Can be called by the client to send a message.
public SendMessage ( Command cmd ) : Task
cmd GlowCommon.DataObjects.Command Message to be sent
return Task
Exemplo n.º 1
0
        /// <summary>
        /// Called by the consumer when they want to send a message to the other side.
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        public async Task <bool> SendCommand(Command cmd)
        {
            lock (objectLock)
            {
                if (!IsConnected || m_commandServer == null)
                {
                    return(false);
                }
            }

            // Send the message
            return(await m_commandServer.SendMessage(cmd));
        }