00001 using System;
00002 using System.Collections;
00003 using GPRSWeb.SmartDeviceClient.Common;
00004
00005 namespace GPRSWeb.SmartDeviceClient.SmartProtocolStack
00006 {
00010 public class IncomingMessageQueue : Common.MessageQueue {
00011 private StackInterface thisStack;
00012
00013 public void ResetConnection() {
00014
00015 }
00016
00017 public IncomingMessageQueue(StackInterface thisStack) {
00018 this.thisStack = thisStack;
00019 }
00020
00021 public void Enqueue(Message msg) {
00022 if (msg.Type == MessageType.Retransmission) {
00023 Segment seg = ((RetransmissionMessage)msg).RawSegment;
00024 seg.IsRetransmission = true;
00025 seg.Headers.TimeReceived = DateTime.Now;
00026 thisStack.GetRemoteHostByID(seg.Headers.SourceDeviceID).AcceptIncomingSegment(seg);
00027 } else {
00028 lock(SyncRoot) {
00029 base.Enqueue(msg);
00030 Monitor.PulseAll(SyncRoot);
00031 }
00032 }
00033 }
00034 }
00035 }