GetChannel() public méthode

Return the QoS set for the given channel or throw an out of range exception.

public GetChannel ( byte idx ) : QosType
idx byte Index in array.
Résultat QosType
 public ConnectionConfigInternal(ConnectionConfig config)
 {
   if (config == null)
     throw new NullReferenceException("config is not defined");
   this.InitWrapper();
   this.InitPacketSize(config.PacketSize);
   this.InitFragmentSize(config.FragmentSize);
   this.InitResendTimeout(config.ResendTimeout);
   this.InitDisconnectTimeout(config.DisconnectTimeout);
   this.InitConnectTimeout(config.ConnectTimeout);
   this.InitMinUpdateTimeout(config.MinUpdateTimeout);
   this.InitPingTimeout(config.PingTimeout);
   this.InitReducedPingTimeout(config.ReducedPingTimeout);
   this.InitAllCostTimeout(config.AllCostTimeout);
   this.InitNetworkDropThreshold(config.NetworkDropThreshold);
   this.InitOverflowDropThreshold(config.OverflowDropThreshold);
   this.InitMaxConnectionAttempt(config.MaxConnectionAttempt);
   this.InitAckDelay(config.AckDelay);
   this.InitMaxCombinedReliableMessageSize(config.MaxCombinedReliableMessageSize);
   this.InitMaxCombinedReliableMessageCount(config.MaxCombinedReliableMessageCount);
   this.InitMaxSentMessageQueueSize(config.MaxSentMessageQueueSize);
   this.InitIsAcksLong(config.IsAcksLong);
   this.InitUsePlatformSpecificProtocols(config.UsePlatformSpecificProtocols);
   this.InitWebSocketReceiveBufferMaxSize(config.WebSocketReceiveBufferMaxSize);
   for (byte idx = 0; (int) idx < config.ChannelCount; ++idx)
   {
     int num = (int) this.AddChannel(config.GetChannel(idx));
   }
 }
 public ConnectionConfigInternal(ConnectionConfig config)
 {
     if (config == null)
     {
         throw new NullReferenceException("config is not defined");
     }
     this.InitWrapper();
     this.InitPacketSize(config.PacketSize);
     this.InitFragmentSize(config.FragmentSize);
     this.InitResendTimeout(config.ResendTimeout);
     this.InitDisconnectTimeout(config.DisconnectTimeout);
     this.InitConnectTimeout(config.ConnectTimeout);
     this.InitMinUpdateTimeout(config.MinUpdateTimeout);
     this.InitPingTimeout(config.PingTimeout);
     this.InitReducedPingTimeout(config.ReducedPingTimeout);
     this.InitAllCostTimeout(config.AllCostTimeout);
     this.InitNetworkDropThreshold(config.NetworkDropThreshold);
     this.InitOverflowDropThreshold(config.OverflowDropThreshold);
     this.InitMaxConnectionAttempt(config.MaxConnectionAttempt);
     this.InitAckDelay(config.AckDelay);
     this.InitMaxCombinedReliableMessageSize(config.MaxCombinedReliableMessageSize);
     this.InitMaxCombinedReliableMessageCount(config.MaxCombinedReliableMessageCount);
     this.InitMaxSentMessageQueueSize(config.MaxSentMessageQueueSize);
     this.InitIsAcksLong(config.IsAcksLong);
     this.InitUsePlatformSpecificProtocols(config.UsePlatformSpecificProtocols);
     this.InitWebSocketReceiveBufferMaxSize(config.WebSocketReceiveBufferMaxSize);
     for (byte idx = 0; (int)idx < config.ChannelCount; ++idx)
     {
         int num = (int)this.AddChannel(config.GetChannel(idx));
     }
 }
 public ConnectionConfigInternal(ConnectionConfig config)
 {
     if (config == null)
     {
         throw new NullReferenceException("config is not defined");
     }
     this.InitWrapper();
     this.InitPacketSize(config.PacketSize);
     this.InitFragmentSize(config.FragmentSize);
     this.InitResendTimeout(config.ResendTimeout);
     this.InitDisconnectTimeout(config.DisconnectTimeout);
     this.InitConnectTimeout(config.ConnectTimeout);
     this.InitMinUpdateTimeout(config.MinUpdateTimeout);
     this.InitPingTimeout(config.PingTimeout);
     this.InitReducedPingTimeout(config.ReducedPingTimeout);
     this.InitAllCostTimeout(config.AllCostTimeout);
     this.InitNetworkDropThreshold(config.NetworkDropThreshold);
     this.InitOverflowDropThreshold(config.OverflowDropThreshold);
     this.InitMaxConnectionAttempt(config.MaxConnectionAttempt);
     this.InitAckDelay(config.AckDelay);
     this.InitMaxCombinedReliableMessageSize(config.MaxCombinedReliableMessageSize);
     this.InitMaxCombinedReliableMessageCount(config.MaxCombinedReliableMessageCount);
     this.InitMaxSentMessageQueueSize(config.MaxSentMessageQueueSize);
     this.InitIsAcksLong(config.IsAcksLong);
     for (byte i = 0; i < config.ChannelCount; i = (byte) (i + 1))
     {
         this.AddChannel(config.GetChannel(i));
     }
 }
Exemple #4
0
 public ConnectionConfigInternal(ConnectionConfig config)
 {
     if (config == null)
     {
         throw new NullReferenceException("config is not defined");
     }
     InitWrapper();
     InitPacketSize(config.PacketSize);
     InitFragmentSize(config.FragmentSize);
     InitResendTimeout(config.ResendTimeout);
     InitDisconnectTimeout(config.DisconnectTimeout);
     InitConnectTimeout(config.ConnectTimeout);
     InitMinUpdateTimeout(config.MinUpdateTimeout);
     InitPingTimeout(config.PingTimeout);
     InitReducedPingTimeout(config.ReducedPingTimeout);
     InitAllCostTimeout(config.AllCostTimeout);
     InitNetworkDropThreshold(config.NetworkDropThreshold);
     InitOverflowDropThreshold(config.OverflowDropThreshold);
     InitMaxConnectionAttempt(config.MaxConnectionAttempt);
     InitAckDelay(config.AckDelay);
     InitMaxCombinedReliableMessageSize(config.MaxCombinedReliableMessageSize);
     InitMaxCombinedReliableMessageCount(config.MaxCombinedReliableMessageCount);
     InitMaxSentMessageQueueSize(config.MaxSentMessageQueueSize);
     InitIsAcksLong(config.IsAcksLong);
     for (byte b = 0; b < config.ChannelCount; b = (byte)(b + 1))
     {
         AddChannel(config.GetChannel(b));
     }
 }
Exemple #5
0
 public ConnectionConfigInternal(ConnectionConfig config)
 {
     if (config == null)
     {
         throw new NullReferenceException("config is not defined");
     }
     InitWrapper();
     InitPacketSize(config.PacketSize);
     InitFragmentSize(config.FragmentSize);
     InitResendTimeout(config.ResendTimeout);
     InitDisconnectTimeout(config.DisconnectTimeout);
     InitConnectTimeout(config.ConnectTimeout);
     InitMinUpdateTimeout(config.MinUpdateTimeout);
     InitPingTimeout(config.PingTimeout);
     InitReducedPingTimeout(config.ReducedPingTimeout);
     InitAllCostTimeout(config.AllCostTimeout);
     InitNetworkDropThreshold(config.NetworkDropThreshold);
     InitOverflowDropThreshold(config.OverflowDropThreshold);
     InitMaxConnectionAttempt(config.MaxConnectionAttempt);
     InitAckDelay(config.AckDelay);
     InitSendDelay(config.SendDelay);
     InitMaxCombinedReliableMessageSize(config.MaxCombinedReliableMessageSize);
     InitMaxCombinedReliableMessageCount(config.MaxCombinedReliableMessageCount);
     InitMaxSentMessageQueueSize(config.MaxSentMessageQueueSize);
     InitAcksType((int)config.AcksType);
     InitUsePlatformSpecificProtocols(config.UsePlatformSpecificProtocols);
     InitInitialBandwidth(config.InitialBandwidth);
     InitBandwidthPeakFactor(config.BandwidthPeakFactor);
     InitWebSocketReceiveBufferMaxSize(config.WebSocketReceiveBufferMaxSize);
     InitUdpSocketReceiveBufferMaxSize(config.UdpSocketReceiveBufferMaxSize);
     if (config.SSLCertFilePath != null)
     {
         int num = InitSSLCertFilePath(config.SSLCertFilePath);
         if (num != 0)
         {
             throw new ArgumentOutOfRangeException("SSLCertFilePath cannot be > than " + num.ToString());
         }
     }
     if (config.SSLPrivateKeyFilePath != null)
     {
         int num2 = InitSSLPrivateKeyFilePath(config.SSLPrivateKeyFilePath);
         if (num2 != 0)
         {
             throw new ArgumentOutOfRangeException("SSLPrivateKeyFilePath cannot be > than " + num2.ToString());
         }
     }
     if (config.SSLCAFilePath != null)
     {
         int num3 = InitSSLCAFilePath(config.SSLCAFilePath);
         if (num3 != 0)
         {
             throw new ArgumentOutOfRangeException("SSLCAFilePath cannot be > than " + num3.ToString());
         }
     }
     for (byte b = 0; b < config.ChannelCount; b = (byte)(b + 1))
     {
         AddChannel(config.GetChannel(b));
     }
 }
 public ConnectionConfigInternal(ConnectionConfig config)
 {
     if (config == null)
     {
         throw new NullReferenceException("config is not defined");
     }
     m_Ptr = InternalCreate();
     if (!SetPacketSize(config.PacketSize))
     {
         throw new ArgumentOutOfRangeException("PacketSize is too small");
     }
     this.FragmentSize          = config.FragmentSize;
     this.ResendTimeout         = config.ResendTimeout;
     this.DisconnectTimeout     = config.DisconnectTimeout;
     this.ConnectTimeout        = config.ConnectTimeout;
     this.MinUpdateTimeout      = config.MinUpdateTimeout;
     this.PingTimeout           = config.PingTimeout;
     this.ReducedPingTimeout    = config.ReducedPingTimeout;
     this.AllCostTimeout        = config.AllCostTimeout;
     this.NetworkDropThreshold  = config.NetworkDropThreshold;
     this.OverflowDropThreshold = config.OverflowDropThreshold;
     this.MaxConnectionAttempt  = config.MaxConnectionAttempt;
     this.AckDelay  = config.AckDelay;
     this.SendDelay = config.SendDelay;
     this.MaxCombinedReliableMessageSize  = config.MaxCombinedReliableMessageSize;
     this.MaxCombinedReliableMessageCount = config.MaxCombinedReliableMessageCount;
     this.MaxSentMessageQueueSize         = config.MaxSentMessageQueueSize;
     this.AcksType = (byte)config.AcksType;
     this.UsePlatformSpecificProtocols  = config.UsePlatformSpecificProtocols;
     this.InitialBandwidth              = config.InitialBandwidth;
     this.BandwidthPeakFactor           = config.BandwidthPeakFactor;
     this.WebSocketReceiveBufferMaxSize = config.WebSocketReceiveBufferMaxSize;
     this.UdpSocketReceiveBufferMaxSize = config.UdpSocketReceiveBufferMaxSize;
     if (config.SSLCertFilePath != null)
     {
         int len = SetSSLCertFilePath(config.SSLCertFilePath);
         if (len != 0)
         {
             throw new ArgumentOutOfRangeException("SSLCertFilePath cannot be > than " + len);
         }
     }
     if (config.SSLPrivateKeyFilePath != null)
     {
         int len = SetSSLPrivateKeyFilePath(config.SSLPrivateKeyFilePath);
         if (len != 0)
         {
             throw new ArgumentOutOfRangeException("SSLPrivateKeyFilePath cannot be > than " + len);
         }
     }
     if (config.SSLCAFilePath != null)
     {
         int len = SetSSLCAFilePath(config.SSLCAFilePath);
         if (len != 0)
         {
             throw new ArgumentOutOfRangeException("SSLCAFilePath cannot be > than " + len);
         }
     }
     for (byte i = 0; i < config.ChannelCount; ++i)
     {
         AddChannel((byte)config.GetChannel(i));
     }
     for (byte i = 0; i < config.SharedOrderChannelCount; ++i)
     {
         IList <byte> sharedOrderChannelsList  = config.GetSharedOrderChannels(i);
         byte[]       sharedOrderChannelsArray = new byte[sharedOrderChannelsList.Count];
         sharedOrderChannelsList.CopyTo(sharedOrderChannelsArray, 0);
         MakeChannelsSharedOrder(sharedOrderChannelsArray);
     }
 }
Exemple #7
0
        public ConnectionConfigInternal(ConnectionConfig config)
        {
            bool flag = config == null;

            if (flag)
            {
                throw new NullReferenceException("config is not defined");
            }
            this.m_Ptr = ConnectionConfigInternal.InternalCreate();
            bool flag2 = !this.SetPacketSize(config.PacketSize);

            if (flag2)
            {
                throw new ArgumentOutOfRangeException("PacketSize is too small");
            }
            this.FragmentSize          = config.FragmentSize;
            this.ResendTimeout         = config.ResendTimeout;
            this.DisconnectTimeout     = config.DisconnectTimeout;
            this.ConnectTimeout        = config.ConnectTimeout;
            this.MinUpdateTimeout      = config.MinUpdateTimeout;
            this.PingTimeout           = config.PingTimeout;
            this.ReducedPingTimeout    = config.ReducedPingTimeout;
            this.AllCostTimeout        = config.AllCostTimeout;
            this.NetworkDropThreshold  = config.NetworkDropThreshold;
            this.OverflowDropThreshold = config.OverflowDropThreshold;
            this.MaxConnectionAttempt  = config.MaxConnectionAttempt;
            this.AckDelay  = config.AckDelay;
            this.SendDelay = config.SendDelay;
            this.MaxCombinedReliableMessageSize  = config.MaxCombinedReliableMessageSize;
            this.MaxCombinedReliableMessageCount = config.MaxCombinedReliableMessageCount;
            this.MaxSentMessageQueueSize         = config.MaxSentMessageQueueSize;
            this.AcksType = (byte)config.AcksType;
            this.UsePlatformSpecificProtocols  = config.UsePlatformSpecificProtocols;
            this.InitialBandwidth              = config.InitialBandwidth;
            this.BandwidthPeakFactor           = config.BandwidthPeakFactor;
            this.WebSocketReceiveBufferMaxSize = config.WebSocketReceiveBufferMaxSize;
            this.UdpSocketReceiveBufferMaxSize = config.UdpSocketReceiveBufferMaxSize;
            bool flag3 = config.SSLCertFilePath != null;

            if (flag3)
            {
                int  num   = this.SetSSLCertFilePath(config.SSLCertFilePath);
                bool flag4 = num != 0;
                if (flag4)
                {
                    throw new ArgumentOutOfRangeException("SSLCertFilePath cannot be > than " + num.ToString());
                }
            }
            bool flag5 = config.SSLPrivateKeyFilePath != null;

            if (flag5)
            {
                int  num2  = this.SetSSLPrivateKeyFilePath(config.SSLPrivateKeyFilePath);
                bool flag6 = num2 != 0;
                if (flag6)
                {
                    throw new ArgumentOutOfRangeException("SSLPrivateKeyFilePath cannot be > than " + num2.ToString());
                }
            }
            bool flag7 = config.SSLCAFilePath != null;

            if (flag7)
            {
                int  num3  = this.SetSSLCAFilePath(config.SSLCAFilePath);
                bool flag8 = num3 != 0;
                if (flag8)
                {
                    throw new ArgumentOutOfRangeException("SSLCAFilePath cannot be > than " + num3.ToString());
                }
            }
            byte b = 0;

            while ((int)b < config.ChannelCount)
            {
                this.AddChannel((int)((byte)config.GetChannel(b)));
                b += 1;
            }
            byte b2 = 0;

            while ((int)b2 < config.SharedOrderChannelCount)
            {
                IList <byte> sharedOrderChannels = config.GetSharedOrderChannels(b2);
                byte[]       array = new byte[sharedOrderChannels.Count];
                sharedOrderChannels.CopyTo(array, 0);
                this.MakeChannelsSharedOrder(array);
                b2 += 1;
            }
        }