Exemple #1
0
 internal MsmqReceiveHelper(MsmqReceiveParameters receiveParameters, Uri uri, IMsmqMessagePool messagePool, MsmqInputChannelBase channel, MsmqChannelListenerBase listener)
 {
     this.queueName         = receiveParameters.AddressTranslator.UriToFormatName(uri);
     this.receiveParameters = receiveParameters;
     this.uri           = uri;
     this.instanceId    = uri.ToString().ToUpperInvariant();
     this.pool          = messagePool;
     this.poisonHandler = Msmq.CreatePoisonHandler(this);
     this.channel       = channel;
     this.listener      = listener;
     this.queue         = Msmq.CreateMsmqQueue(this);
 }
 internal MsmqReceiveHelper(MsmqReceiveParameters receiveParameters, Uri uri, IMsmqMessagePool messagePool, MsmqInputChannelBase channel, MsmqChannelListenerBase listener)
 {
     this.queueName = receiveParameters.AddressTranslator.UriToFormatName(uri);
     this.receiveParameters = receiveParameters;
     this.uri = uri;
     this.instanceId = uri.ToString().ToUpperInvariant();
     this.pool = messagePool;
     this.poisonHandler = Msmq.CreatePoisonHandler(this);
     this.channel = channel;
     this.listener = listener;
     this.queue = Msmq.CreateMsmqQueue(this);
 }
 private static void ReadServerMode(MsmqChannelListenerBase listener, ServerModeDecoder modeDecoder, byte[] incoming, long lookupId, ref int offset, ref int size)
 {
     do
     {
         if (size <= 0)
         {
             throw listener.NormalizePoisonException(lookupId, modeDecoder.CreatePrematureEOFException());
         }
         int num = modeDecoder.Decode(incoming, offset, size);
         offset += num;
         size   -= num;
     }while (ServerModeDecoder.State.Done != modeDecoder.CurrentState);
 }
 static void ReadServerMode(MsmqChannelListenerBase listener, ServerModeDecoder modeDecoder, byte[] incoming, long lookupId, ref int offset, ref int size)
 {
     for (;;)
     {
         if (size <= 0)
         {
             throw listener.NormalizePoisonException(lookupId, modeDecoder.CreatePrematureEOFException());
         }
         int decoded = modeDecoder.Decode(incoming, offset, size);
         offset += decoded;
         size -= decoded;
         if (ServerModeDecoder.State.Done == modeDecoder.CurrentState)
             break;
     }
 }
 static void ReadServerMode(MsmqChannelListenerBase listener, ServerModeDecoder modeDecoder, byte[] incoming, long lookupId, ref int offset, ref int size)
 {
     for (;;)
     {
         if (size <= 0)
         {
             throw listener.NormalizePoisonException(lookupId, modeDecoder.CreatePrematureEOFException());
         }
         int decoded = modeDecoder.Decode(incoming, offset, size);
         offset += decoded;
         size   -= decoded;
         if (ServerModeDecoder.State.Done == modeDecoder.CurrentState)
         {
             break;
         }
     }
 }
 private static void ReadServerMode(MsmqChannelListenerBase listener, ServerModeDecoder modeDecoder, byte[] incoming, long lookupId, ref int offset, ref int size)
 {
     do
     {
         if (size <= 0)
         {
             throw listener.NormalizePoisonException(lookupId, modeDecoder.CreatePrematureEOFException());
         }
         int num = modeDecoder.Decode(incoming, offset, size);
         offset += num;
         size -= num;
     }
     while (ServerModeDecoder.State.Done != modeDecoder.CurrentState);
 }