Пример #1
0
 /// <summary> Tries to send the message, and if there is an error reconnects and tries again. </summary>
 private void  trySend(NuGenTransportLayer theTransport, NuGenTransportable theTransportable)
 {
     try
     {
         theTransport.send(theTransportable);
     }
     catch (NuGenTransportException)
     {
         theTransport.disconnect();
         theTransport.connect();
         theTransport.send(theTransportable);
     }
 }
Пример #2
0
        /// <summary> Tries to receive a message, and if there is an error reconnects and tries again. </summary>
        private NuGenTransportable tryReceive(NuGenTransportLayer theTransport)
        {
            NuGenTransportable message = null;

            try
            {
                message = theTransport.receive();
            }
            catch (NuGenTransportException)
            {
                theTransport.disconnect();
                theTransport.connect();
                message = theTransport.receive();
            }
            return(message);
        }
 public virtual void  disconnect()
 {
     myTransportA.disconnect();
     myTransportB.disconnect();
 }