Esempio n. 1
0
 public CosmosDiagnosticsContextCore(
     string operationName,
     string userAgentString)
 {
     this.UserAgent     = userAgentString ?? throw new ArgumentNullException(nameof(userAgentString));
     this.OperationName = operationName ?? throw new ArgumentNullException(nameof(operationName));
     this.StartUtc      = DateTime.UtcNow;
     this.ContextList   = new BoundedList <CosmosDiagnosticsInternal>(Capacity);
     this.Diagnostics   = new CosmosDiagnosticsCore(this);
     this.overallScope  = new CosmosDiagnosticScope("Overall");
 }
Esempio n. 2
0
        public TrafficHandler(ITrafficHandler eventHandler)
        {
            this.eventHandler = eventHandler;
            reliableMonitor   = new ReliableMonitor(this);

            packetReceivedCallbacks = new Dictionary <Packet.Reliability, Action <Packet> >();
            packetReceivedCallbacks[Packet.Reliability.None]       = packet => { };
            packetReceivedCallbacks[Packet.Reliability.Ack]        = OnAckReceived;
            packetReceivedCallbacks[Packet.Reliability.Reliable]   = OnReliableReceived;
            packetReceivedCallbacks[Packet.Reliability.Unreliable] = OnUnreliableReceived;

            latestReceived = new BoundedList <Packet>(1024 * 8);

            pendingOut = new BlockingQueue <Packet>();
        }
Esempio n. 3
0
 /*  Private Methods
  *  ==========================================================================*/
 private void initDice()
 {
     Dice = new BoundedList<GameObject>(MAX_DICE);
     foreach(GameObject die in initialDice)
         Dice.Add(die);
 }
 public BoundedListEnumerator(BoundedList <K> list)
 {
     this.list = list;
 }