Exemplo n.º 1
0
 //------------------------------------------------------------------------
 public void BroadcastSend(CDEFMessage msg)
 {
     msg.ToDesc.Descriptor = SessionDescriptor.BroadcastDescriptor;
     msg.FromDesc = mFrom;
     mConn.Send(msg.Message);
 }
Exemplo n.º 2
0
 //------------------------------------------------------------------------
 public void Send(CDEFMessage msg)
 {
     msg.ToDesc = mTo;
     msg.FromDesc = mFrom;
     mConn.Send(msg.Message);
 }
Exemplo n.º 3
0
        //--------------------------------------------------------------------
        //
        // Send a disconnect message and close the connection
        // if that is wanted
        //
        public bool Disconnect(CDEFMessage msg, bool disconnectAfterSend)
        {
            bool ret = true;

            if (this.Connected())
            {
                //
                // Disconnect if that is what they want
                // may not be what they want if the connection has multiple sessions
                //
                if (disconnectAfterSend)
                {
                    mDisconnect.Set();
                }
                Send(msg.Message);
            }
            else  // we may be in "connecting" state
            {
                ret = Disconnect();
            }
            return ret;
        }