Exemplo n.º 1
0
        /// <summary>
        /// Send a message to the remote host that this client handler is connected to.
        /// </summary>
        /// <param name="message">
        /// The message.
        /// </param>
        public void Send(Message message)
        {
            try
            {
                NetworkThreadContext.AssertSendIsValid((IPEndPoint)this.m_Client.Client.RemoteEndPoint);

                lock (this.m_Client)
                {
                    this.m_MessageIo.Send(this.m_Client.GetStream(), message);
                }
            }
            catch (ObjectDisposedException)
            {
                // The client is no longer available.
                // TODO: Remove the client from the lookup list.
            }
        }