Ejemplo n.º 1
0
 public virtual void  send(MessageEnvelope message)
 {
     if (isAvailable())
     {
         ByteBuffer buffer = messageCoder.encode(message);
         send(buffer);
     }
     else
     {
         throw new System.IO.IOException("Transport is not connected!");
     }
 }
Ejemplo n.º 2
0
 public virtual void  pushAliveReqForRecipients()
 {
     if (this.messageCoder != null)
     {
         lock (aliveRequestCheckList)
         {
             MessageEnvelope envelope = new MessageEnvelope();
             MessageBody     body     = new MessageBody();
             AliveRequest    req      = new AliveRequest();
             envelope.Id   = ("-PING-");
             req.Timestamp = (System.DateTime.Now.Ticks);
             body.selectAliveRequest(req);
             envelope.Body = (body);
             ByteBuffer buffer;
             try
             {
                 buffer = messageCoder.encode(envelope);
                 foreach (Transport transport in aliveRequestCheckList)
                 {
                     pushPacket(transport, buffer);
                 }
             }
             catch (System.Exception e)
             {
                 Console.WriteLine(e.ToString());
             }
         }
     }
 }